-
Notifications
You must be signed in to change notification settings - Fork 51
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
Enhancement: support hex floats #14
Comments
I like this idea. Anyone want to take a crack as modifying the parser to permit such Hexadecimal floats? |
`
` |
Testing usefulness in Calc (my version):
|
The above code will "overflow" or "underflow" because of the limitations of long long, so:
` |
Added test for "overflow": |
Expand value range of tolerated hex floats by 16X:
#define maximum_mantissa_digit_count 15
}` Test code: Test results: I've tried to use something approximating usual C style (excepting the use of array notation). Looking at Calc parsing, it looks to be well beyond my competence to fully integrate this code at the parsing level. And of course, integrated at that level, one could support quadruple hex floats, etc. Have fun. |
@kcrossen May I ask why you submitted all this code as comments? There is a merge request facility? |
I think Fabrice Bellard has already done it long ago with his numcal app, along with a lot of other features, check it out here : |
I don't understand the bulk (nearly any of) of the parsing code, which makes the usual form of posting this problematic. |
Furthermore, I don't know how to use the relevant github tools (which I use for my own code about like I used to use sourceforge). |
Calc is maintained on GitHub, not sourceforge. GitHub has lots of good documentation that you should consider. |
@kcrossen Github is mostly just git plus a web interface. |
We hope to address this, perhaps sometime next month, in a 2.14.1.x non-production release. |
Hexadecimal floats are a formatting for floating point values supported in C since C99. It shows the mantissa in hex. This is useful because it shows the exact number with no rounding or decimal approximation.
E.g. 0.486224 is
0x1.eff2bp+6
.The text was updated successfully, but these errors were encountered: