[vtk-developers] Call for Comments: Ascii representation of floats and doubles in files

Ben Boeckel ben.boeckel at kitware.com
Thu Mar 1 17:30:00 EST 2018


On Fri, Mar 02, 2018 at 11:05:24 +1300, Todd via vtk-developers wrote:
> Can this not be simply achieved by base64 encoding the value as bytes and
> saving as a string?  Isn't a float always 10 bytes? 
> 
> It is more verbose, but there would be no loss of precision. It looks like VTK
> already has base64 utilities, so another library would not be needed.

There is also the hexfloat format, but that has endian-ness issues, same
as any other binary-in-ascii output. It is also likely to make files
backwards-incompatible (older releases don't know how to read a hexfloat
or base64-encoded float).

--Ben


More information about the vtk-developers mailing list