Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#654 closed defect (invalid)

TYPE-OF incorrect for bignums

Reported by: jch Owned by: gb
Priority: minor Milestone:
Component: Runtime (threads, GC) Version: trunk
Keywords: Cc:


CL-USER> (lisp-implementation-version)
"Version 1.5-dev-r13405M-trunk  (LinuxX8664)"
CL-USER> (type-of (expt 2 64))
(INTEGER 1152921504606846976)
CL-USER> (type-of (expt 2 100))
(INTEGER 1152921504606846976)
CL-USER> (type-of (expt 2 1000))
(INTEGER 1152921504606846976)
CL-USER> (type-of (expt 2 10000))
(INTEGER 1152921504606846976)

Change History (5)

comment:1 Changed 11 years ago by gb

I don't know what this has to do with type inference.

What do you think is incorrect about the type specifier returned by TYPE-OF in those cases ?

comment:2 Changed 11 years ago by jch

Doesn't (INTEGER n) imply that the value is between 0 and n-1? (expt 2 10000) is certainly not between 0 and 1152921504606846975 (it has over 3000 decimal digits).

My guess is that TYPE-OF is reporting all integers as fixnums.

comment:3 Changed 11 years ago by jch

  • Summary changed from Incorrect type inference for bignums to TYPE-OF incorrect for bignums

comment:4 Changed 11 years ago by gb

  • Resolution set to invalid
  • Status changed from new to closed

(INTEGER n) is shorthand for (INTEGER n *) which means "all integers >= n". You may be thinking of (MOD n), which is shorthand for (INTEGER 0 (n)).

comment:5 Changed 11 years ago by jch

You're right, my apologies.

Note: See TracTickets for help on using tickets.