From: Piotr Fusik (P.Fusik_at_elka.pw.edu.pl)
Date: 2003-03-07 18:35:54
On Fri, 7 Mar 2003, Groepaz wrote: > since there exist routines for converting about anything into a > long...maybe its an idea to convert to long first, and have a long->fp > conversion only. ... and probably unsigned long - what C standard says? > > > The comparision is a bit tricky - there are signed 0s, infinites and NaNs. > > Optimizing single comparision operator routines isn't probably the good > > way - there should be some common code for comparision. Note that some > > optimizations are not legal for IEEE floats (e.g. !(a>=b) is not > > neccessarily (a<b)). > > mmmh could you explain the latter? just curious :O) > float NaN = 0.0 / 0.0; printf("%d\n", !(NaN >= NaN)); /* 1 */ printf("%d\n", NaN < NaN); /* 0 */ Simply result of comparision anything with NaN is false. Piotr ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo_at_musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2003-03-07 18:36:46 CET