[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Finding largest integer
- To: BUG-LISP at MIT-MC
- Subject: Finding largest integer
- From: Carl W. Hoffman <CWH at MIT-MC>
- Date: Thu, 1 May 80 06:48:00 GMT
- Cc: MICHAEL HOROWITZ AT CMU-10A at MIT-MC, KMP at MIT-MC, Dave.Touretzky at CMU-10A
- Original-date: 1 May 1980 02:48-EDT
Date: 30 April 1980 1812-EDT
From: Dave Touretzky at CMU-10A
Is there any variable or status call in MacLisp that gives the maximum
integer (excluding bignums) and minimum integer representable on the
machine? I know the answer, I just want to know if I can get MacLisp
to tell me.
Date: 30 APR 1980 1830-EDT
From: KMP at MIT-MC (Kent M. Pitman)
My FORTRAN stuff would love to know this, too. Perhaps a (STATUS INFINITY)?
A (STATUS WORDSIZE) would probably help, but for languages like NIL that
won't use all the bits for representing the number, both are really needed.
Assuming that two's complement arithmetic is being used, (ROT 1 -1) will
give you the smallest fixnum, and (LSH -1 -1) will give you the largest
fixnum. (HAULONG (ROT 1 -1)) will give you the number of bits in a fixnum.
Outside of code that is a part of the Lisp system, there should be no need
to know the actual wordsize of the machine. Bit vectors are available in
both LMLisp and NIL.