[Omake] Lm_hash.HashCode.add_float ignores some of the bits on
the 32-bit platforms?
Jason Hickey
jyh at cs.caltech.edu
Tue Mar 20 09:36:59 PDT 2007
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
> _______________________________________________
> OMake-Devel mailing list
> OMake-Devel at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake-devel
--
Jason Hickey http://www.cs.caltech.edu/~jyh
Caltech Computer Science Tel: 626-395-6568 FAX: 626-792-4257
More information about the OMake-Devel
mailing list