var x = (4 * y) + "px";
floating-point constant
float-to-string conversion
floating-point multiplication
string concatenation
0.3
0
sign
exponent
mantissa
(-1)^s * (1.mantissa)2 * 2^(exponent-bias)
01101
0011001101
0.300048828125
exactly
0
sign
exponent
mantissa
01101
0011001101
0.300048828125
exactly
0.2999267578125
0.3001708984375
0.300048828125
0.3?
Most libc and stdlib
SUPER FAST
Name ips average deviation median 99th % Ryu 80.26 12.46 ms ±7.14% 12.19 ms 14.98 ms OTP 25.36 39.43 ms ±14.13% 38.02 ms 62.33 ms Comparison: Ryu 80.26 OTP 25.36 - 3.16x slower +26.97 ms
SUPER FAST
Stephan T. Lavavej, “Floating-Point <charconv>: Making Your Code 10x Faster With C++17's Final Boss”
Ulf Adams, "Ryū: Fast Float-to-String Conversion"