-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support floating-point formatting #2
Comments
|
Some more questions occurred, why I choose Dragon4. My selection criteria were:
Results for 4., shortest formdragonbox > (is faster than) ryu > grisu-exact > dragon4 Reference: Results for 4., fixed-precision formfloff> (is faster than) ryu > grisu2 > dragon4 Reference: Results for 3., binary code size
Reference:
Results for 2., shortest form and fixed-precision form
Conclusion: To offer both forms, I would have to combine different algorithms, which in turn increases the binary size. Results for 1., format and scanAs far as I am aware of, only with arbitrary integer arithmetic a string can be exactly parsed into a double. Please correct me if a am wrong! So with Dragon4, which already uses arbitrary integer arithmetic, I can save binary code size. But I also don't know a good algorithm & implementation of the parsing part yet... Current WinnerDragon4, because the code reuse decreases the required binary size significant. The downsides of Dragon4:The current implementation is based on https://github.com/rust-lang/rust/blob/71ef9ecbdedb67c32f074884f503f8e582855c2f/library/core/src/num/flt2dec/strategy/dragon.rs because it was the cleanest I have found. it is a slow algorithm
Reference:
requires much stack sizeEmbedded devices often have less RAM (128 kB - 2 MB). If an RTOS is used, each task stack is a fraction of it. One big integer object requires 140 bytes (size_t + 34 * 4 bytes) (32 bit system).
|
The text was updated successfully, but these errors were encountered: