> magit-blame-parse: Arithmetic range error: "truncate", 1329521119.0
>
> I'm not sure but remember reading from somewhere that the biggest integer in
> Emacs is not 32bits. If that is true, the number "1329521119" here is
> 0x4F3EE1DF, which is 31 bits, could be out of the range already. Any idea?

OK, I have confirmed that the integer number in Emacs is 30 bits, which is the
reason of these problems. I have fixed the issue and sent a pull request. Here
is a description of the algorithm:

The UNIX TIME is a 32 bit integer, however, since integer number in Emacs is
only 30 bits, the UNIX TIME has to be represented by a floating point number.
The algorithm is to first divide the time (floating point number) by 4, which is
equivalent to right shifting 2 bits to make a 30 bits integer number (discarding
the lowest 2 bits). Since this number is the higher 30 bits of the time, by
right shifting 14 bits we get the HIGH (16 bits) part. The original floating
point time mod 4 we get the lowest 2 bits of the time. Take the 30 bits number
calculated in the earlier steps, wipe out the higher 16 bits and we get the
higher 14 bits of the LOW part, left shifting 2 bits and "inclusive or" the
lowest 2 bits we get the final LOW part, therefor, converted the floating point
UNIX TIME to the (HIGH LOW) format representation.

York

Reply via email to