Portability of binary serialization of double/float type in C++

后端 未结 9 2219
余生分开走
余生分开走 2020-11-27 15:50

The C++ standard does not discuss the underlying layout of float and double types, only the range of values they should represent. (This is also true for signed types, is i

9条回答
  •  忘掉有多难
    2020-11-27 16:23

    Just write the binary IEEE754 representation to disk, and document this as your storage format (along with is endianness). Then it's up to the implementation to convert this to its internal representation if necessary.

提交回复
热议问题