Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: binary data files Message-ID: <1989May1.191126.8958@utzoo.uucp> Organization: U of Toronto Zoology References: <10946@bloom-beacon.MIT.EDU> <12546@ut-emx.UUCP> <1271@l.cc.purdue.edu> Date: Mon, 1 May 89 19:11:26 GMT In article <1271@l.cc.purdue.edu> cik@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@zoo.toronto.edu