[Gambas-user] Elusive Gambas3 crashing bug
Benoît Minisini
gambas at ...1...
Fri Nov 12 20:04:12 CET 2010
> More from GambasTester project....
>
>
> A.
>
> According to documentation these functions are same:
> Debug Ang(-1, 1)
> Debug ATan2(-1, 1)
>
> 2.35619449019235
> -0.785398163397448
>
> So, Atan2 seems to make errors.
The documentation is not accurate enough. Ang() and ATan2() are the same
functions, except that their arguments are inverted!
>
>
> B.
>
> Cos(ACos(0.5)) = 0.5 and Tan(ATan(0.5)) = 0.5 are False!
> Tan(ATan(0.5)) - 0.5 gives 1E-16, so this is seems to be precision problem.
> Is this OK?
Yes. You often have precision problems with floating numbers.
I have the plan to use the "==" operator to implement a floating point
comparison that would ignore the unsignificant digits, but I must find the
good algorithm first.
Regards,
--
Benoît Minisini
More information about the User
mailing list