[cmucl-help] 0 to a power

Matt Kaufmann kaufmann at cs.utexas.edu
Fri Jan 1 15:51:54 UTC 2016


Hi --

I'm seeing that evaluation of (expt 0 10001) results in an error, as
does (expt 0 k) for any k above 10000 as far as I can tell.  Details
are in the log below.  Interestingly, a base of 1 doesn't cause this
problem; e.g., (expt 1 10000000000000000000000) evaluates to 1; so I
wonder if the error with 0 could be avoided.

dunnottar:~% /projects/acl2/lisps/cmucl/cmucl-2015-09-x86-linux/bin/lisp
CMU Common Lisp snapshot-2015-09 (20F Unicode), running on dunnottar
With core: /v/filer4b/v11q001/acl2/lisps/cmucl/cmucl-2015-09-x86-linux/lib/cmucl/lib/lisp-sse2.core
Dumped on: Sun, 2015-08-30 17:46:35-05:00 on lorien3
See <http://www.cmucl.org/> for support information.
Loaded subsystems:
    Unicode 1.29 with Unicode version 6.2.0
    Python 1.1, target Intel x86/sse2
    CLOS based on Gerd's PCL 2010/03/19 15:19:03
* *features*

(:GERDS-PCL :PCL-STRUCTURES :PORTABLE-COMMONLOOPS :PCL :CMU20 :CMU20F :PYTHON
 :MODULAR-ARITH :MP :X86 :SSE2 :LINKAGE-TABLE :RELATIVE-PACKAGE-NAMES
 :EXECUTABLE :ELF :LINUX :GLIBC2 :UNIX :RANDOM-MT19937 :GENCGC :CMUCL :UNICODE
 :COMPLEX-FP-VOPS :HASH-NEW :ALIEN-CALLBACK :DOUBLE-DOUBLE :HEAP-OVERFLOW-CHECK
 :STACK-CHECKING :COMMON-LISP :ANSI-CL :IEEE-FLOATING-POINT :CMU)
* most-positive-fixnum

536870911
* (expt 0 10001)

The absolute value of 10001 exceeds limit 10000.
   [Condition of type KERNEL::INTEXP-LIMIT-ERROR]

Restarts:
  0: [CONTINUE ] Continue with calculation
  1: [NEW-LIMIT] Continue with calculation, update limit
  2: [ABORT    ] Return to Top-Level.

Debug  (type H for help)

(KERNEL::INTEXP 0 10001)
Source: Error finding source: 
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:
  target:code/irrat.lisp.
0] 

Regards,
Matt


More information about the cmucl-help mailing list