[BUG] Float>>tan

Ned Konz ned at bike-nomad.com
Wed Aug 22 23:46:34 UTC 2001


On Wednesday 22 August 2001 01:35 pm, you wrote:
> Folks,
>
> Last night, I evaluated the following expression
>
> (Float halfPi) tan
>
> and I got "8.16588936419192e15" as the result!
> This is not the tangent of 90 degrees, i.e. (Float halfPi), isn´t ;-)
> The Float>>tan implementation is written as "^self sin / self cos". In this
> case, "self cos" should have evaluated to zero and we should have got a
> division by zero.
> Am I missing something here?

Precision.

"Float halfPi cos" evaluates to a very small number (the reciprocal of the 
number above, about 1.225e-16 on my system). Should be 0.

Note that
Float infinity arcTan = Float halfPi
answers true, if it helps.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list