login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxMaxSingleInteger revision 1 of 5

1 2 3 4 5
Editor: hemmecke
Time: 2008/08/08 08:06:17 GMT-7
Note:

changed:
-
The maximum of SingleInteger is not really maximal.


\begin{spad}
)abbrev package MYSINT MySingleInteger
MySingleInteger: Public == Private
  where
    Public == with
      mymax: () -> SingleInteger
      mymax2: () -> SingleInteger
    Private  == add
      mymax(): SingleInteger == max()$SingleInteger + 1
      mymax2(): SingleInteger == mymax() + 1
\end{spad}



\begin{axiom}
a: SingleInteger := max()$SingleInteger
m: SingleInteger := mymax()
m2: SingleInteger := mymax2()
(2^31, 2^32, 2^63, 2^64)
b: SingleInteger := 2^63-1
c: SingleInteger := b+1
\end{axiom}

On my 32 bit system
I get

\begin{verbatim}
(1) -> )co aaa.spad

(1) -> m: SingleInteger := mymax()

   (1)  - 2147483648
                                                          Type: SingleInteger
(2) -> m2: SingleInteger := mymax2()

   (2)  - 2147483647
                                                          Type: SingleInteger
(3) -> (2^31, 2^32, 2^63, 2^64)

   (3)  [2147483648,4294967296,9223372036854775808,18446744073709551616]
                                                  Type: Tuple PositiveInteger
(4) -> b: SingleInteger := 2^63-1

   (4)  - 1
                                                          Type: SingleInteger
(5) -> c: SingleInteger := b+1

   (5)  0
                                                          Type: SingleInteger
\end{verbatim}


The maximum of SingleInteger? is not really maximal.

spad
)abbrev package MYSINT MySingleInteger
MySingleInteger: Public == Private
  where
    Public == with
      mymax: () -> SingleInteger
      mymax2: () -> SingleInteger
    Private  == add
      mymax(): SingleInteger == max()$SingleInteger + 1
      mymax2(): SingleInteger == mymax() + 1
spad
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/8495752304085420655-25px001.spad using 
      old system compiler.
   MYSINT abbreviates package MySingleInteger 
------------------------------------------------------------------------
   initializing NRLIB MYSINT for MySingleInteger 
   compiling into NRLIB MYSINT 
   compiling exported mymax : () -> SingleInteger
      MYSINT;mymax;Si;1 is replaced by QSPLUSMOST-POSITIVE-FIXNUM1 
Time: 0.03 SEC.
compiling exported mymax2 : () -> SingleInteger Time: 0.01 SEC.
(time taken in buildFunctor: 0)
;;; *** |MySingleInteger| REDEFINED
;;; *** |MySingleInteger| REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor MySingleInteger Time: 0.04 seconds
finalizing NRLIB MYSINT Processing MySingleInteger for Browser database: --->-->MySingleInteger((mymax ((SingleInteger)))): Not documented!!!! --->-->MySingleInteger((mymax2 ((SingleInteger)))): Not documented!!!! --->-->MySingleInteger(constructor): Not documented!!!! --->-->MySingleInteger(): Missing Description ; compiling file "/var/zope2/var/LatexWiki/MYSINT.NRLIB/MYSINT.lsp" (written 09 MAY 2010 09:37:46 AM): ; compiling (/VERSIONCHECK 2) ; compiling (PUT (QUOTE |MYSINT;mymax;Si;1|) ...) ; compiling (DEFUN |MYSINT;mymax;Si;1| ...) ; compiling (DEFUN |MYSINT;mymax2;Si;2| ...) ; compiling (DEFUN |MySingleInteger| ...) ; compiling (DEFUN |MySingleInteger;| ...) ; compiling (MAKEPROP (QUOTE |MySingleInteger|) ...) ; compiling (MAKEPROP (QUOTE |MySingleInteger|) ...)
; /var/zope2/var/LatexWiki/MYSINT.NRLIB/MYSINT.fasl written ; compilation finished in 0:00:00.073 ------------------------------------------------------------------------ MySingleInteger is now explicitly exposed in frame initial MySingleInteger will be automatically loaded when needed from /var/zope2/var/LatexWiki/MYSINT.NRLIB/MYSINT

axiom
a: SingleInteger := max()$SingleInteger

\label{eq1}1152921504606846975(1)
Type: SingleInteger
axiom
m: SingleInteger := mymax()
>> System error: The value 1152921504606846976 is not of type FIXNUM.

On my 32 bit system I get


(1) -> )co aaa.spad</p>
<h2>(1) -> m: SingleInteger<a class=? := mymax()

(1) - 2147483648 Type: SingleInteger? (2) -> m2: SingleInteger? := mymax2()

(2) - 2147483647 Type: SingleInteger? (3) -> (2^31, 2^32, 2^63, 2^64)

(3) [2147483648,4294967296,9223372036854775808,18446744073709551616]? Type: Tuple PositiveInteger? (4) -> b: SingleInteger? := 2^63-1

(4) - 1 Type: SingleInteger? (5) -> c: SingleInteger? := b+1

(5) 0 Type: SingleInteger? " title=" (1) -> )co aaa.spad

(1) -> m: SingleInteger? := mymax()

(1) - 2147483648 Type: SingleInteger? (2) -> m2: SingleInteger? := mymax2()

(2) - 2147483647 Type: SingleInteger? (3) -> (2^31, 2^32, 2^63, 2^64)

(3) [2147483648,4294967296,9223372036854775808,18446744073709551616]? Type: Tuple PositiveInteger? (4) -> b: SingleInteger? := 2^63-1

(4) - 1 Type: SingleInteger? (5) -> c: SingleInteger? := b+1

(5) 0 Type: SingleInteger? " class="equation" src="images/9221662633349395318-16.0px.png" width="628" height="421"/>