I'm not sure, but generally speaking converting doubles to strings will fail to round trip at least the NaNs
If round tripping is important, my recommendation would be to output something that directly corresponds to the binary representation of the float. For example, printf %a
If round tripping is important, my recommendation would be to output something that directly corresponds to the binary representation of the float. For example, printf %a