-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 3/25/2007 4:54 AM: > Eric Blake wrote: >> You can also assume IEEE rules, and compare against signed infinity: >> 1 / +0. => +infinity >> 1 / -0. => -infinity > > Nice trick :-)
Thanks for correcting my typo; which I realized after I sent my other message. :) > > But here you depend on the IEEE rules for exceptions upon division by zero. > - On Alpha processors, division by zero (and even overflow!) leads to a > SIGFPE > signal by default. And it requires the use of a system call to change > the FP exceptions control mask (the <fenv.h> routines in glibc >= 2.1, > the __setfpucw function in glibc 2.0). memcmp is certainly much cheaper. Raw operations on bits is much faster than actual floating point in a number of cases; as you have noted, the problem is the portability in detecting where the raw bits are. Your method appears fine to me. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGBoBe84KuGfSFAYARAqLNAJ4tA6sWiQhBHpuCW99z55TcvPEvDgCfXOKB 519nbAi5YgVMyMX8AuaRyvI= =IMUI -----END PGP SIGNATURE-----