-
Notifications
You must be signed in to change notification settings - Fork 50
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
no_std implemenatation #15
Conversation
First reactions:
It does make this harder to review, but in general I really like having smaller more-focused source files. I ought to do that throughout more of num...
Ok, that's expected.
That's unfortunate. Perhaps we can rewrite this with
Ouch, losing
Using |
Thanks comment.
I missed
I think so. I will try to rewrite
I see your concern. They should be separated as you say.
I think I should pull out the file split part into another PR. The submodules described above help us considering the no_std compatibility respectively, and re-merging them is not a good way I think. |
If you're ready to split up your PR as you mentioned, num-traits 0.2.1 now contains |
Based on @termoshtt's rust-num#15, without the intrusive file splitting. I also addressed the other review comments I had left there. The limitations of `no_std` are the missing implementations of `Error` and methods based on `Float`, although `FloatCore` is now used for a few things. Format widths are also not supported, as I couldn't find a way to do this without using a temporary `String`. Co-authored-by: Toshiki Teramura <toshiki.teramura@gmail.com>
22: Add no_std support r=cuviper a=cuviper Based on @termoshtt's #15, without the intrusive file splitting. I also addressed the other review comments I had left there. The limitations of `no_std` are the missing implementations of `Error` and methods based on `Float`, although `FloatCore` is now used for a few things. Format widths are also not supported, as I couldn't find a way to do this without using a temporary `String`. Fixes #6. Closes #15. Co-authored-by: Josh Stone <cuviper@gmail.com>
It's an attempt to use num-complex in
no_std
setting.I have split
src/lib.rs
intosrc/{lib,math,fmt,from_str}.rs
for incremental testing. These submodules are disabled whenno_std
becausemath
needsstd
mathematical functions (e.g.atan2
)fmt
needsformat!
from_str
needsString
Num
is included here due tofrom_str_radix
Basically, I did not modify any implementations of each functions.
This PR depends
FloatCore
rust-num/num-traits#32 which is not included in num-traits 0.2, and usegit
andrev
in Cargo.toml.Float
/FloatCore
are switched inlib.rs
(FloatCore as Float
) for common functions e.g.is_infinite()
, andmath
module usesFloat
only.Sorry for inconvenient diff due to file splitting.
Thanks.