chart library
viewtopic.php?f=11&p=154#p154
)
I was going to change function evalFuncX(f$,x)) so in case of math range error it returned magic number. So I could omit these ranges.
But it seems LBB has problems reporting such errors from EVAL
- no errors happens, weird results are returned.
Things I found:
sqr(negative number) - no error in EVAL, bogus result
Code: Select all
'print sqr(-2) 'Negative root
print eval("sqr(-2)") '-2 ???
print eval("sqr(1.2-3)") '-3 ???
Code: Select all
'print (-1)^0.5 'Logarithm range
'print eval("(-1)^0.5")'Logarithm range
Code: Select all
'print 1/0 'div by zero
'print eval("1/0") 'div by zero
Code: Select all
'print 2 mod 0 'div by zero
print eval("2 mod 0") '2
Code: Select all
'print exp(40000) 'exponent range
print eval("exp(40000)") '0
Code: Select all
'print log(-2) 'logarithm range
print eval("log(-2)") '-2
Code: Select all
'print acs(2) 'negative root - how's that?
print eval("acs(2)") '0
Code: Select all
'print asn(2) 'negative root - how's that?
print eval("asn(2)") '0