Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!zaphod.mps.ohio-state.edu!rpi!bu.edu!bucrf11.bu.edu!tjh From: tjh@bucrf11.bu.edu (Tim Hall) Newsgroups: comp.sys.sgi Subject: HUGE Message-ID: <72495@bu.edu.bu.edu> Date: 17 Jan 91 00:19:17 GMT Sender: news@bu.edu.bu.edu Reply-To: tjh@bu-pub.bu.edu (Tim Hall) Followup-To: comp.sys.sgi Organization: Boston University Lines: 40 The following pertains to PI's and 4D/2xx machines running 3.3.1... Awhile ago I growled about setting a float value to "HUGE" and then testing to see if that float value == HUGE and the result would be not true. After awhile I thought about it and figured I'd been dumb in assigning HUGE to a float (I use it as a sort of "NULL" float value) and I should attenuate HUGE and then life will be good. No such luck. The following line is from math.h #define HUGE 3.40282347e+38 /*max decimal value of a "float" */ ^^^^^ The following code demonstrates my problem..... #include #include #define NOVALUE ((float)(HUGE * 0.001)) /* Surely this will produce a ^^^^^^ valid float value! (Ha) */ main( ) { float a; a = NOVALUE; printf( "%f %f\n", NOVALUE, a ); /* They look exactly the same! */ if ( a == NOVALUE ) /* But noooooooooooooooooooooo */ printf( "Equal\n" ); else printf( "Not Equal\n" ); } So the final question is - is it me? Shouldn't this work? It used to. -- -Tim Hall tjh@bu-pub.bu.edu GO BU! BEAT BC!