ryu
ryu copied to clipboard
Converts floating point numbers to decimal strings
Would it be possible to control whether the number is printed in exponent or decimal notation? Or, if more convenient, return the chosen location for the decimal point, if present,...
Feature request to add a parameter that can control the number of decimal places returned. For example: * `doubleToString( -0.331678f, 2 )` returns `"-0.33"`. * `doubleToString( -0.331678f, 5 )` returns...
It would be nice if a user could specify the string representation of infinity and NaN values. For example: - "nan" instead of "NaN" - "inf" instead of "Infinity"
Hi. Going forward, would it be possible to 'label' any commits or issues targeting the C implementation? This would greatly help in keeping in sync any ports of the C...
I'm working with something that possibly will become an IETF standard: https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-02 It depends on number formatting compatible with ES6/V8. A short test revealed that the Java version of Ryu...
ryu_parse does not return the number of characters processed, so we are forced to tokenize the input before feeding it to `s2d`. `s2d` already knows when to stop consuming the...
Hey @ulfjack, thanks for the great algorithm! Quick question: should this be a loop rather than an if, or was that intentional? https://github.com/ulfjack/ryu/blob/b2ae7a712937711375a79f894106a0c6d92b035f/ryu/d2s.c#L414 I haven't tried building your benchmarks yet,...
Please, consider replacing of [this loop](https://github.com/ulfjack/ryu/blob/d4114cedf9de3a9504e0fc21e212ef1043af64c7/ryu/f2s.c#L277-L284) by the following code: ``` while (vm % 10 == 0) { vm /= 10; vr = vm; lastRemovedDigit = 0; ++removed; } ```...
Going from double to string is amazing using this lib, but I am having trouble efficiently and correctly parsing a string into a double. This is what I have, any...
About two times slower on numbers in range 0..9, about 1.5 times slower on numbers in range 0..999. This is important because your library is pretending to be fastest: >...