binary data files

Henry Spencer henry at utzoo.uucp
Tue May 2 05:11:26 AEST 1989


In article <1271 at l.cc.purdue.edu> cik at l.cc.purdue.edu (Herman Rubin) writes:
>There is another bad thing.  We may not have a good ASCII representation for
>the data... example is floating
>point data; there is no standard floating point binary, and conversion to and
>from decimal is a source of roundoff errors, which may even be serious.

Binary and decimal do not cover the entire space of possibilities.  The
problem is not in conversion to a text form, it's in base conversion.  If
you are willing to assume that floating point is binary, it's conceivable
to convert floating point to octal or hex rather than decimal.

Also, if you have well-behaved (IEEE) floating point conversions, and allow
enough digits, you may not have roundoff errors.
-- 
Mars in 1980s:  USSR, 2 tries, |     Henry Spencer at U of Toronto Zoology
2 failures; USA, 0 tries.      | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list