[Omake] Lm_hash.HashCode.add_float ignores some of the bits on the 32-bit platforms?

Aleksey Nogin anogin at hrl.com
Tue Mar 20 09:30:15 PDT 2007


Jason,

Lm_hash.HashCode.add_float is currently defined as:

    let add_float buf x =
       let i = Int64.bits_of_float x in
          add_int buf (Int64.to_int (Int64.shift_right i 6));
          add_int buf (Int64.to_int (Int64.shift_right i 3));
          add_int buf (Int64.to_int i)

As I understand, Int64.to_int would return the rightmost 31 bits out of 
the 64 on the 32-bit platforms. So, the above code would take into 
account bits 0-30, then 3-33, then 6-36, while ignoring bits 37-63. Am I 
missing something? If not, was this intentional?

-- 
Aleksey Nogin, Research Staff Member
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA


More information about the OMake-Devel mailing list