Earlier quoted context omitted.
Real-time displays often need to show floating point numbers as they change. As a simple example, the time remaining display of a music player ticks down as the music plays. Now in this case, it is easy to fake it by using integers and then placing the decimal point, but if you were controlling something complex in real time you might not be able to do this as easily.
> it is easy to fake it by using integers and then placing the decimal point That's not "faking it", that using fixed point numbers [1]. They are a great alternative if the numbers stay in roughly the same magnitude, and are much saner when dealing with e.g. money. 1: https://en.wikipedia.org/wiki/Fixed-point_arithmetic
Ryū: Fast Float-To-String Conversion
21–30 of 45 posts
Re: Ryū: Fast Float-To-String Conversion
#22Other than printing out the numbers, what are the practical applications?
Re: Ryū: Fast Float-To-String Conversion
#23https://dl.acm.org/citation.cfm?id=3192369
That's really appreciated; thanks.
Re: Ryū: Fast Float-To-String Conversion
#24Other than printing out the numbers, what are the practical applications?
Re: Ryū: Fast Float-To-String Conversion
#25Does anyone know of a good decimal float to string converter, preferably in c?
Re: Ryū: Fast Float-To-String Conversion
#26(De-)Serialization being such a common task both in Servers and clients nowadays I wonder if special instructions would make sense in CPUs
Re: Ryū: Fast Float-To-String Conversion
#27Earlier quoted context omitted.
Often, numbers in JS happen to be just integers. Would the implementation optimize for that case?
Javascript JITs specialize for integers already. I don't know if Ryū does specifically though.
Re: Ryū: Fast Float-To-String Conversion
#28The paper is open-access at ACM: https://dl.acm.org/citation.cfm?id=3192369 That's really appreciated; thanks.
Re: Ryū: Fast Float-To-String Conversion
#29This is in a track called "PLDI Research Papers - Floats and Maps". Is that because they had one paper on maps and two on floats, and decided to put them together, or is there some deep connection between the two?
Re: Ryū: Fast Float-To-String Conversion
#30(De-)Serialization being such a common task both in Servers and clients nowadays I wonder if special instructions would make sense in CPUs
At that point just base-64 for your IEEE floats.... Because anywhere where you need that speed you can better handle it without using strings...
If you are starting from scratch, and want to support only platforms that support IEEE754 in hardware, and so on, then yes, just serialize the raw bits.