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
FIX display incorrect #412
Comments
This is intentional, according to the following comment // Check if we need to switch to scientific notation in normal mode
// On the negative exponents, we switch when digits would be lost on
// display compared to actual digits. This is consistent with how HP
// calculators do it. e.g 1.234556789 when divided by 10 repeatedly
// switches to scientific notation at 1.23456789E-5, but 1.23 at
// 1.23E-11 and 1.2 at 1.2E-12 (on an HP50G with 12 digits).
// This is not symmetrical. Positive exponents switch at 1E12.
// Note that the behaviour here is purposely different than HP's
// when in FIX mode. In FIX 5, for example, 1.2345678E-5 is shown
// on HP50s as 0.00001, and is shown here as 1.23457E-5, which I believe
// is more useful.
// Also, since DB48X can compute on 34 digits, and counting zeroes
// can be annoying, there is a separate setting for when to switch
// to scientific notation. |
Discussion here: https://www.hpmuseum.org/forum/thread-20653.html |
I think in FIX mode, we are not supposed to see "E" Scientific notation switch really signals FIX conversion failed
To count zeroes, I found that normalized mode is better: 0.1 ≤ |mantissa| < 1 12345000 --> 0.12345e+008 --> 8 digits integer part |
Solving this by adding a new setting, This selects the minimum number of significant digits before switching to The default value is 0, which is similar to how HP calculators A higher value will switch to scienfic mode to show at least the given In other words, setting the value to |
The goal here is to emulate what HP calculators did.
The goal is to enable that precise behaviour, while also enabling my preferred behavior, which is to show extra decimals instead of useless zeros.
The problem of counting zeroes is not a software problem, it is a practical problem for humans. HP will display 10 or 12 digits depending on the model, so you could end up with |
Select the minimum number of significant digits before switching to scientific notation in `FIX` mode. The default value is 0, which is similar to how HP calculators perform. For example, with `2 FIX`, the value `0.055` will display as `0.06`, and `0.0055` will display as `0.01`. A higher value will switch to scienfic mode to show at least the given number of digits. For instance, with `2 FIX`, if the value is `1`, then `0.055` will still display as `0.06` but `0.0055` will display as `5.50E-3`. If the value is `2`, then `0.055` will display as `5.5E-2`. In other words, setting the value to `0` emulates the behaviour of HP calculators. Seting the value to `34` will switch to scientific notation if not all digits can be displayed Fixes: #412 Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
I don't quite understand what 0 significant digit (HP behavior) mean. Can you post the formula, for deciding when the switch (FIX --> SCI) occurs? |
This is my attempt at understanding new feature, in terms of ULP FIX04, 1 ULP = 0.0001 Dig=0: flip = 10^0 / 2 = 0.5 ULP Dig=1, flip = 10^1 / 2 = 5 ULP |
Select the minimum number of significant digits before switching to scientific notation in `FIX` mode. The default value is 0, which is similar to how HP calculators perform. For example, with `2 FIX`, the value `0.055` will display as `0.06`, and `0.0055` will display as `0.01`. A higher value will switch to scienfic mode to show at least the given number of digits. For instance, with `2 FIX`, if the value is `1`, then `0.055` will still display as `0.06` but `0.0055` will display as `5.50E-3`. If the value is `2`, then `0.055` will display as `5.5E-2`. In other words, setting the value to `0` emulates the behaviour of HP calculators. Seting the value to `34` will switch to scientific notation if not all digits can be displayed Fixes: #412 Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Just update with my guess of formula, before issue get closed FIX-N: ULP = 10^(-N) But, symmetric version may be better, with all FIX notation error ≤ 1/2 ULP FLIP = (10^Dig - 1/2) ULP Dig<0: FLIP < 0.0 ULP (will not flip to SCI) |
This release implements the last remaining user-oriented RPL data type, unit objects. However, unit operations are not implemented yet. There is no unit arithmetic nor unit conversions yet. New features: - Multi-line rendering of result level (#455) - Render graphic objects in graphical rendering mode (#453) - DM32 documentation is now distinct from DM42 (#450) - Improvements to `FIX` rounding (#445, #446) - Save editor state when using EXIT (#439) - Add images in web documentation, skip them in on-line help (#438) - Fixed-base based numbers now enabled on DB50X (#432) - `Integrate` automatically enables approximations (#415) - New `MinimumSignificantDigits` (`DIG`) setting (#412) - Add `CursorBlinkRate` setting (#407) - Unit objects and menus, but no arithmetic or conversions yet (#16) Bug fixes: - Graphical mode for stack rendering (still showing as "grey" intentionally) - Computation of complex log / power when not in radians (#452) - Merge the two "Help" sections in the documentation (#451) - Do not emit error for `"ABC" 5 *` with `NumericResults` on (#447) - Allow `PowerOff` and `Save` to work in Alpha mode (#444) - Show `Help` as the command name when help topic not found (#440) - Fixing in ordering of command-line history (#439) - Avoid `Invalid digit for base` error for `1E6` (#422) - Show correct symbol, `∡`, for Alpha-Shift-EEX (#421) - Update menus when a setting changes (#416) Improvements: - Add `[]` inserter in matrix menu (#456) - Leave one pixel blank on right of stack (#454) - Machine-specific variations in the documentation (#450) - Many minor changes and corrections in documentation - Improvement to storytelling file (#448) - Link DB48X YouTube playlist from documentation - Update acknowledgements section - Improve rendering of shift keys in built-in help (#437) - Increase maximum size for big numbers (#426) - Accept `LogGamma` as alternative spelling for `lgamma` (#426) - Directly execute menu functions in direct mode (#420) - Add `Authors` section in documentation (#419) - Make on-line help accessible on GitHub and GitLab (#418) - Rename simulator to `db48x` (#417) - Add `∫` to `IntegrationMenu` entries (#414) Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This release implements the last remaining user-oriented RPL data type, unit objects. However, unit operations are not implemented yet. There is no unit arithmetic nor unit conversions yet. New features: - Multi-line rendering of result level (#455) - Render graphic objects in graphical rendering mode (#453) - DM32 documentation is now distinct from DM42 (#450) - Improvements to `FIX` rounding (#445, #446) - Save editor state when using EXIT (#439) - Add images in web documentation, skip them in on-line help (#438) - Fixed-base based numbers now enabled on DB50X (#432) - `Integrate` automatically enables approximations (#415) - New `MinimumSignificantDigits` (`DIG`) setting (#412) - Add `CursorBlinkRate` setting (#407) - Unit objects and menus, but no arithmetic or conversions yet (#16) Bug fixes: - Fix computation of 2^256 (#460) - Use a unicode font for command name rendering (#459) - Graphical mode for stack rendering (still showing as "grey" intentionally) - Computation of complex log / power when not in radians (#452) - Merge the two "Help" sections in the documentation (#451) - Do not emit error for `"ABC" 5 *` with `NumericResults` on (#447) - Allow `PowerOff` and `Save` to work in Alpha mode (#444) - Show `Help` as the command name when help topic not found (#440) - Fixing in ordering of command-line history (#439) - Avoid `Invalid digit for base` error for `1E6` (#422) - Show correct symbol, `∡`, for Alpha-Shift-EEX (#421) - Update menus when a setting changes (#416) Improvements: - Improve generation of font file for more reliable builds (#458) - Improve contrast of selected line in square menus (#457) - Add `[]` inserter in matrix menu (#456) - Leave one pixel blank on right of stack (#454) - Machine-specific variations in the documentation (#450) - Many minor changes and corrections in documentation - Improvement to storytelling file (#448) - Link DB48X YouTube playlist from documentation - Update acknowledgements section - Improve rendering of shift keys in built-in help (#437) - Increase maximum size for big numbers (#426) - Accept `LogGamma` as alternative spelling for `lgamma` (#426) - Directly execute menu functions in direct mode (#420) - Add `Authors` section in documentation (#419) - Make on-line help accessible on GitHub and GitLab (#418) - Rename simulator to `db48x` (#417) - Add `∫` to `IntegrationMenu` entries (#414) Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
13.72 / 25.4
should display as0.5402
, but currently displays as5.4016e-1
.Reported by Ben Hagler
The text was updated successfully, but these errors were encountered: