Big integers?

Q&A's, tips, howto's
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Big integers?

Post by HPW »

Code: Select all

newLISP v.8.9.8 on Win32 MinGW.

> (/ 951984987716899 2)
-1551688047
> (setq a 951984987716899)
1191591203
> (setq a 951984987716899.0)
9.519849877e+014
> (int 951984987716899.0)
1191591203
Doc: Integers larger than 9,223,372,036,854,775,807 are truncated to 9,223,372,036,854,775,807. Integers smaller than -9,223,372,036,854,775,808 are truncated to -9,223,372,036,854,775,808.

What do I wrong?
Hans-Peter

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

These look correct (although my eyes go funny when I look at them...:-):

Code: Select all

newLISP v.8.9.8 on OSX UTF-8, execute 'newlisp -h' for more info.
> (/ 951984987716899 2)
475992493858449
>  (setq a 951984987716899) 
951984987716899
> (setq a 951984987716899.0)
9.519849877e+14
> (int 951984987716899.0) 
951984987716899
> 
so there's something odd.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

So it seems to be a Win32 MinGW bug.
;-(
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, there is definitely a problem with the new 64Bit stuff on Win32 MinGW, I will investigate.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Fortunately this was only a display problem with ints on Win32, fixed in development version 8.9.9. See announcement in news section.

Lutz

Locked