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

Allow math --scale=max for maximum digits #5579

Closed
floam opened this issue Jan 24, 2019 · 6 comments
Closed

Allow math --scale=max for maximum digits #5579

floam opened this issue Jan 24, 2019 · 6 comments

Comments

@floam
Copy link
Member

@floam floam commented Jan 24, 2019

math should have an easier way of showing the maximum digits possible for floating point numbers than increasing -s until you get an error (15 currently, which corresponds to FLT_DIG. This could perhaps go up a little bit if we decided to use long double - I plan to do this to tinyexpr.cpp).

The most straightforward thing would be just letting the user pass -1 for a scale that is limited only by precision.

@floam floam self-assigned this Jan 24, 2019
@floam
Copy link
Member Author

@floam floam commented Jan 24, 2019

I'm a little annoyed I forgot to report this and do it before fish 3.0.0.

@faho
Copy link
Member

@faho faho commented Jan 24, 2019

Do we want just "-1", or also -2, -3 and so on, which seems kinda useless?

Or do we want --scale=max?

@floam
Copy link
Member Author

@floam floam commented Jan 24, 2019

Do we want just "-1", or also -2, -3 and so on, which seems kinda useless?

Seems useless to me. The way I started doing it was just the special value of -1: floam@cbb7fcb

Or do we want --scale=max?

That might be a better experience for the user.

@zanchey zanchey added this to the fish-future milestone Jan 25, 2019
@ridiculousfish
Copy link
Member

@ridiculousfish ridiculousfish commented Jan 25, 2019

+1 to --scale=max

@floam floam changed the title Allow math --scale -1 for maximum digits Allow math --scale=max for maximum digits Jan 25, 2019
@faho faho removed this from the fish-future milestone Feb 13, 2019
@faho faho added this to the fish 3.1.0 milestone Feb 13, 2019
@faho
Copy link
Member

@faho faho commented Feb 13, 2019

Fixed in ca5b7c0.

@faho faho closed this Feb 13, 2019
@floam
Copy link
Member Author

@floam floam commented Feb 14, 2019

Cool!

@floam floam removed their assignment Feb 14, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants