Hi Jim,
Those are the changes:
If you run this line:
print log(0)
the result will be:
-inf
Solved
I also split the error message ERROR_LOGRANGE into:
ERROR_LOGRANGE "Unable to calculate the logarithm of a number less than or equal to 0"
ERROR_SQRRANGE "Unable to calculate the root of a negative number"
Run this
print acos(10)
print asin(-9)
You will get:
nan.0
nan.0
Solved
Add also ERROR_ASINACOSRANGE "Unable to calculate the arc-sine or arc-cosine of a value outside the interval [-1.0, +1.0]"
Run this:
print 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
result:
inf
or this:
print tan(99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)
result:
nan
Solved
Add error message at compiling time COMPERR_NUMBERTOOLARGE: "Number too large"
Run this using WARN to bad type conversion:
print cos ("999999999999e500")
The result is:
WARNING on line 1: Unable to convert string to number, zero used.
nan.0
Solved
An integer can be printed using 10 digits:
print 2147483647
So, there is no reason to have the minumum value of Settings panel -> "Number of digits to print numbers": 8
In this case an integer will be printed by using 10 digits and the same number as floating point will look a lot different:
print 2147483647
print 214748364.0
result:
2147483647
2.147484e+9
Solved
Change min value of "Number of digits to print numbers" from preferences panel to 10 (the number of digits of an integer)
This is a continuation of the discussion: https://sourceforge.net/p/kidbasic/patches/36/
Set "Number of digits to print numbers" to 10.
Set "Always show decimal point on floating point numbers" to true
Run this:
print 0.12345678912345
print 9.12345678912345
print 9999999999
print 0.0
print 1234567891.0
It will print:
0.123456789
9.12345679 # 9 digits
9999999999.0 # 11 digits
0 # where is floating point?
1e+9 # what?
Solved
The (new) correct output is:
0.123456789
9.123456789
9.999999999e+9
0.0
1.234567891e+9
Respectfully,
Florin Oprea