more sun and vax diffs
John DeTreville
jdd at allegra.UUCP
Thu Aug 16 07:36:13 AEST 1984
--------
From: gwyn at BRL-VLD.ARPA
Newsgroups: net.unix-wizards
Subject: Re: more sun and vax diffs
Date: Sun, 19-Aug-84 00:58:24 EDT
From: Doug Gwyn (VLD/VMB) <gwyn at BRL-VLD.ARPA>
It is NOT proper to print "Infinity" in a numeric field that may
have to be read back in by another program (even if the Sun scanf()
can convert the string back into proper internal form, which I doubt,
the output may be shipped to another system to be input).
--------
It is my impression that the Sun internally uses the new IEEE standard
floating-point format (coming soon to a CPU near you). The IEEE standard
reserves a bit-pattern for "infinity", which is returned for operations such
as 1.0/0.0 (negative infinity is returned by -1.0/0.0); infinities obey the
rules of arithmetic as well as they can.
Unfortunately, the C language makes no provision for such things: there is
no number which can be printed out for infinity that could possibly be read
in as infinity.
Does the new C standard address this problem?
Cheers,
John ("Not Infinite") DeTreville
Bell Labs, Murray Hill
More information about the Comp.unix.wizards
mailing list