Page 1 of 1

about precision

Posted: Wed Apr 05, 2006 10:24 am
by talun
Hi to all,
if possible I would like to know the precison of the math functions of PureBasic 4 beta 9.
For example for the square root of a number, the Pow function seems more precise than the Sqr() function (see the simple test below)

;------- test code -----------
x.d = 2
Debug Pow(x,0.5)
Debug Sqr(x)
;-----------------------------

Any suggestions?

Thanks!

Sergio

Posted: Wed Apr 05, 2006 11:54 am
by Fred
You have found an issue with the 'Debug' command, it's now fixed. It should not affect the programs, for example: e.d = Sqr(x) should give the correct result.

Posted: Wed Apr 05, 2006 12:31 pm
by talun
Fred, many thanks for your reply. I've slightly modified my test code and all works fine (the result is 0)

;------- test code -----------
x.d = 2
Debug StrD(Sqr(x)-Pow(x,0.5))
;-----------------------------

thanks :D

Sergio