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?
Value of MAXINT?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Value of MAXINT?
Yes, because there are no special "integers" in smart BASIC.
Imaginary part has the same precision as real part.
Imaginary part has the same precision as real part.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Value of MAXINT?
Actually you can easily check this. Code:
returns: 100
Code: Select all
k=2^52
m=k-150
n=k-50
PRINT n-m
Re: Value of MAXINT?
Thank you. That was what I thought, but I wanted to be certain.