pub fn write_double(buf: &mut [u8; 32], d: f64) -> &[u8] ⓘExpand description
Writes a double into a fixed buffer, byte for byte what push_double
would append.
The two are the same code now, and this is the one that does the work, because the digit generator wants somewhere to put eighteen digits before it knows how many of them it is going to keep. The caller that needs it as a buffer rather than as a reply is the array type, which stores a value as a double only when the double prints back as the exact bytes the client sent, so it formats a candidate, compares, and usually throws it away.