-
Notifications
You must be signed in to change notification settings - Fork 135
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
Use the libm crate for a full Float on no_std #75
Comments
|
Sure, we can hold off until it's more ready -- I'm not in any rush. It could still be useful to do early exploration though, to identify any other shortcomings that |
* Numeric traits are replaced with their core counterparts. * Errors don't need to implement std:error::Error any more. * Altitude-from-pressure was commented out until there is a libm implementation of powf ([1], probably) [1]: rust-num/num-traits#75
99: Revive Float+Real in no_std thanks to libm r=cuviper a=yoanlcq Greetings, This is a hopeful fix for #75. Basically: Add `libm` as an optional dependency, and handle three possible cases depending on which features are enabled: - std and libm: std is used; - std and not libm: std is used; - libm and not std: libm and FloatCore are used. It was briefly mentioned that `libm` wasn't ready yet, but this was months ago, and I believe it is better not to wait for too long. If anything, bugs in `libm` should be fixed in `libm`; `num-traits` is only delegating its implementations to it; not to mention that the more `libm` is used, the likelier issues are to be found and hopefully fixed. Thanks in advance! Co-authored-by: Yoan Lecoq <yoanlecoq.io@gmail.com> Co-authored-by: Josh Stone <cuviper@gmail.com>
Since #99 was merged shouldn't this be closed ? Edit: If closing please also consider publishing a new version this would permit updating other crates (Ogeon/palette#145) thanks :) |
I will try to get to it this week. |
What's the status of this? It's been two weeks. Sorry for maybe pinging this early, but this is my last blocker (and it looks like a lot of other crates are waiting too). |
Same here, this is the only thing that is missing for me as well |
Sorry for the delay -- num-traits 0.2.9 is now published! |
Currently,
num_traits::Float
is only available withstd
, andno_std
only has the more limitedFloatCore
without all of transcendental functions likesqrt
,sin
, etc. The newlibm
crate might be the way out of this, as an optional dependency to getFloat
onno_std
too!There's also
Real
and the signed and floating-pointPow
(mapping topowi
andpowf
) which all requirestd
now, and should be feasible withlibm
. I'm not sure aboutMulAdd
andMulAddAssign
though.The text was updated successfully, but these errors were encountered: