[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(SXHASH '(1 . 0))



Ron,
   There seems to be some confusion here.  First of all,
the PDP-10 is a two's-complement machine, so the word
octal 400000000000 isn't -0, but -2^35.  It's just as good
as any other integer.  SXHASH returns integers in the range
[-2^35,2^35-1] (that is, those which fit into single PDP-10
words).
   Now, indeed ABS of this number will overflow and fail,
*if* ABS somehow believes that it is not allowed to use bignums;
this should only happen in *compiled* code where the compiler
believes that it can open-code ABS.  This could happen because
of a compiler bug, or because you declared (FIXSW T).
   In the interpreter (REMAINDER (ABS (SXHASH '(1 . 0))) 5000.)
works fine.  A bignum gets used for the result of ABS.
   I suggest that you pursue this further to discover the problem.
However, another way to express the computation is
(ABS (REMAINDER (SXHASH '(1 . 0)) 5000.)), which does the
same thing because REMAINDER is symmetric about the origin
in its first argument.
--Guy