Page 1 of 1

Value of MAXINT?

Posted: Fri Mar 06, 2015 5:04 pm
by Gordon
I see from the manual (thanks to @Dutchman) that Smart BASIC uses standard 64-bit floating point numbers in 1-11-52 bit patterns for sign-power-mantissa parts.

Can I infer from this that any integer with an absolute value smaller than 2^52 will be represented exactly, without rounding, and that if I do arithmetic on integers in that range and the result is also an integer in that range, the result will also be represented exactly, without rounding?

Is this also true of the imaginary parts of complex numbers?

Re: Value of MAXINT?

Posted: Fri Mar 06, 2015 5:19 pm
by Mr. Kibernetik
Yes, because there are no special "integers" in smart BASIC.

Imaginary part has the same precision as real part.

Re: Value of MAXINT?

Posted: Fri Mar 06, 2015 5:27 pm
by Mr. Kibernetik
Actually you can easily check this. Code:

Code: Select all

k=2^52
m=k-150
n=k-50
PRINT n-m
returns: 100

Re: Value of MAXINT?

Posted: Sun Mar 08, 2015 8:29 am
by Gordon
Thank you. That was what I thought, but I wanted to be certain. :-)