-
Notifications
You must be signed in to change notification settings - Fork 8
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
exponential format not used if value is zero #48
Comments
What do you think that the output should be? And what's special about zero? I mean, why with zero and not with every other number when the uncertainty is bigger than the value? |
I think that the output should be 0.000(1234)e-9 rather than 0(12340000000), more similar to what happens when the value is not zero, when the exponential format is used for expressing values/uncertainties >= 1e6. Regarding values !=0 with uncertainties larger than the values, I see that with the change I suggest here plus the change for getting the decimal point, I get a reasonable formatting:
|
I think you mean
which should be...
I'm interested here in the formatting with the current default notation, which will continue, as I mentioned in #47, even if we implement your proposal as an optional notation. So please don't merge the issues. Besides, this particular example is just fine now:
|
I did mean 0.000(1234)e-9, with e10 I would prefer
With the modification I propose:
In my opinion, a value of zero is not just like a value smaller than its uncertainty, it is rather a value that does not set a scale, and the best scale to minimize the formatted string can be conveniently set by using the scale of the uncertainty. Let me show an example of what happens with the present code:
and what happens with the modification I propose
Having a value=0 permits formatting both as |
When the value is zero and the uncertainty a very small or very large number, then the exponential format is not used, but it ought to be in my opinion. This is an example
A possible way to get an exponential formatting could be to get the exponent from the uncertainty when the values is zero, i.e. in print.R changing from
to
Cheers,
The text was updated successfully, but these errors were encountered: