Wow, what a weird non-bug... By printing out a float as a hexadecimal value I find that 0.0 == 0x0 on my Intel Pentium Pro with MSVC 5.0. Now, when root reads back a 0.0 from my data file it stores 0x80000000, a 32 bit word with the high bit set. This is also zero (try setting these two zeros to floats and then testing for equivalence... they are). The trick. If you do "cout << temp", when temp is the first form of the zero float, then the stream library prints out a true zero, "0". If you print out the second form, it prints out a "1.#QUAN" instead of 0. While I don't know exactly what the specifications are for an Intel floating point zero, it might be simpler to change the root machine independent conversion routines than to fix the MSVC library? :-) I first stumbled across this error when using the Dump() routine for objects that were read in. Sigh. Cheers, Gordon.
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:21 MET