[MLton] real hash table

Matthew Fluet fluet@cs.cornell.edu
Mon, 29 May 2006 18:38:22 -0400 (EDT)


> There definitely should not be any `numerical artifacts' because going from a
> 64-bit to an 80-bit real is one-to-one.

Right, but the issue is that going from an 80-bit real to a 64-bit 
real/word is many-to-one.  I'm just noting that if there were a primitive:
   val Real64.toWord: Real64.real -> Word64.word
(which, I note that you can simulate with PackReal/PackWord operations), 
and you have code like:

   val w1 = Real64.toWord r1
   val w2 = Real64.toWord r2
   val r = if w1 = w2
              then r1 - r2
              else 0.0

then if r1 and r2 are carried in FP registers, then its possible that the 
result in r is not-equal to zero, because r1 and r2 might be equal at 
64-bits, but not equal at 80-bits and their difference is representable at 
64-bits.