tiberio@seismo.UUCP (Mike Tiberio) (08/08/84)
a program, run on a sun and on a 780, both with 4.2 BSD:
main()
{
double log10();
printf("%f\n", log10(0.));
}
sun responds:
Infinity
vax responds:
-73891372717101319000000000000000000000.000000
may the joker responsible for the answer found on the sun be shot!
seismo!tiberio
brian@uwvax.ARPA (08/09/84)
I don't know if I would go so far as to shoot the "joker". At least he made an attempt at giving the right answer, even though he was wrong. The vax answer, however, can't even be construed as an attempt at the correct answer, it's ludicrous and WRONG. Anyway, what little I remember from high school calculus tells me that log10(0) is UNDEFINED, not Infinity. This is because ten to any power does not equal zero. Cheers to the Sun programmer who had the idea... I love it. -- Brian Pinkerton @ wisconsin ...!{allegra,heurikon,ihnp4,seismo,sfwin,ucbvax,uwm-evax}!uwvax!brian brian@wisc-rsch.arpa
chris@umcp-cs.UUCP (08/10/84)
Actually, it makes sense that the sun would say ``Infinity'': log10(0.0) returns the largest (smallest?) possible machine value and sets errno to EDOM. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland
tomk@ur-laser.uucp (Tom Kessler) (08/21/84)
minor FLAME. I if you bothered to read the manual (and I quote) (ahemm), " The %e, %f,and %g formats print IEEE indeterminate values (infinity or not-a-number) as 'Infinity' or 'Nan" respectively." See its not a bug they EVEN documented it. FLAME EXTINGUISHED -- -------------------------- Tom Kessler {allegra |seismo }!rochester!ur-laser!tomk Laboratory for Laser Energetics Phone: (716)- 275 - 3786 250 East River Road 275 - 3194 Rochester, New York 14623
wb@gamma.UUCP (Bill Beblo) (08/26/84)
My experience with the Sun 2 workstation is that it returns a value which is printed via printf as "NAN" (not a number). I was under the impression this had something to do with the IEEE standard for floating point software. They claim they conform. My question is whether or not they are consistent when using their Sky hardware FP processor. Bill Beblo Bell Communications Research 600 Mountain Avenue Murray Hill, New Jersey 07974 (201) 582-7365
sunny@sun.uucp (Sunny Kirsten) (08/27/84)
>My experience with the Sun 2 workstation is that it returns a value >which is printed via printf as "NAN" (not a number). I was under >the impression this had something to do with the IEEE standard >for floating point software. They claim they conform. My question >is whether or not they are consistent when using their Sky >hardware FP processor. >Bill Beblo In the sun architecture the math libraries sense the presence/absence of the Sky Fast Floating Point Processor Board, and automatically call it if present. There are compile options to force a non-transportable optimized compile which calls the Sky driver directly, rather than calling the math library and letting it decide. -- {ucbvax|decvax|ihnp4}!sun!sunny (Sunny Kirsten of Sun Microsystems)
tomk@ur-laser.uucp (Tom Kessler) (08/28/84)
I tried several examples with the sky board on my SUN 150 with the SUN2 cpu and got NAN and INFINITY in all of the cases where I did on the SUN 100 without sky floating point. -- -------------------------- Tom Kessler {allegra |seismo }!rochester!ur-laser!tomk Laboratory for Laser Energetics Phone: (716)- 275 - 3786 250 East River Road 275 - 3194 Rochester, New York 14623
geoff@callan.UUCP (08/31/84)
>My experience with the Sun 2 workstation is that it returns a value >which is printed via printf as "NAN" (not a number). I was under >the impression this had something to do with the IEEE standard >for floating point software. They claim they conform. My question >is whether or not they are consistent when using their Sky >hardware FP processor. > Bill Beblo > Bell Communications Research The Sky FP unit is IEEE-488, and thus will return NAN's and infinity when appropriate. The SUN printf routines recognize these as special cases and print them specially. Thus, I would expect all to work just find when using the Sky board. Isn't it interesting that Sunny Kirsten of Sun answered a totally different question that wasn't even raised in Beblo's posting, and the correct answer had to come from one of Sun's hottest competitors? -- Geoff Kuenning Callan Data Systems ...!ihnp4!wlbr!callan!geoff
geoff@callan.UUCP (Geoff Kuenning) (08/31/84)
Oops. My fingers got ahead of me. IEEE-488 is a bus; I don't know the number of the floating point standard off the top of my head. Anyway, the Sky FP is IEEE floating point, not IEEE-488. Sorry. -- Geoff Kuenning Callan Data Systems ...!ihnp4!wlbr!callan!geoff