[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:50:15 PDT 2007
OK, fixed in rev. 10246.
On 20.03.2007 09:36, Jason Hickey wrote:
> Oops, those were supposed to be byte counts:(
>
> IT should shift right by 6*8 and 3*8.
>
> Jason
>
> On Mar 20, 2007, at 9:30 AM, Aleksey Nogin wrote:
>
>> 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