Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could libm be removed ? #446

Closed
yjhmelody opened this issue Sep 17, 2022 · 2 comments
Closed

Could libm be removed ? #446

yjhmelody opened this issue Sep 17, 2022 · 2 comments
Labels
question Further information is requested

Comments

@yjhmelody
Copy link
Contributor

It seems that no_std could works well without libm. I want to know ther reason about import it? For performance?

@Robbepop
Copy link
Member

Robbepop commented Sep 17, 2022

My gut feeling is "no" but I forgot why. 🙃
In the past we used libm because the Rust standard library did not support the required floating point instructions under certain circumstances such as compilation to WebAssembly in no_std mode.
I don't know if this is still the case ...

Importants links:

I would certainly love if we were able to safely remove libm.

@Robbepop Robbepop added the question Further information is requested label Sep 17, 2022
@Robbepop
Copy link
Member

We indeed need libm since some f32 and f64 methods such as fract and trunc are not available in Rust's core library unfortunately. This may change in the future though since some people are working on that.

Compare the following docs for f32:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants