-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Implement LowerExp and UpperExp for integers #39479
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Thanks @clarcharr, looks interesting and simple enough for me. I can look into this. |
@clarcharr seems like the implementation for Line 1539 in 86d9ed6
Do you think we can just reuse it? |
That code is strongly tied to floats. I don't believe it can be reused for (64- and 128-bit) integers at all, but even if, it would probably be much more painful than just writing a clean-room implementation tailored to integers. |
I agree that a separate implementation for integers would be easier than trying to use the float one. I would love a PR to add these impls! |
implement LowerExp and UpperExp for integers Addresses rust-lang#39479 This implementation is heavily based on the preexisting `macro_rules! impl_Display` in the same file. I don't like the liberal use of unsafe in that macro and would like to modify it so `unsafe` is only present where necessary. What is Rust's policy on doing such modifications? Also, I couldn't figure out where to put tests, can I have some help with that?
I fixed this with #66721, but this issue wasn't automatically closed |
Uh oh!
There was an error while loading. Please reload this page.
I'd be willing to work on this at some point, but I figured that I'd offer this as a feature request in case someone else is interested.
It's very useful to be able to print large integers in scientific notation to get a glance at what order of magnitude they are. For example, seeing 1e10 is much easier to comprehend than 10000000000.
The text was updated successfully, but these errors were encountered: