about precision

Just starting out? Need help? Post your questions and find answers here.
talun
User
User
Posts: 28
Joined: Mon May 05, 2003 3:53 pm
Location: Italy

about precision

Post 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
Fred
Administrator
Administrator
Posts: 18383
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
talun
User
User
Posts: 28
Joined: Mon May 05, 2003 3:53 pm
Location: Italy

Post 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
Post Reply