From: Phrogz Date: 2009-12-23T14:05:11+09:00 Subject: Re: Trig value errors On Dec 22, 8:47 pm, jzakiya wrote: > We know cos(PI/2)=0 not 6.123023176911189e-17, so round > it, truncate, whatever, to 0. Make it mathematically correct by > whatever arithmetic process you choose. We know that cos( π/2 ) = 0, yes. But Math::PI ≠ π. Math::PI ≈ π. Similarly, Math::PI/2 ≠ π/2, so of course it's reasonable to say that Math.cos( Math::PI/2 ) ≈ 0.0, but perhaps not exactly. 9e-17 is insignificantly small. Perhaps you want to round or truncate? > I'm > saying the current trigs implementations has by design (a choice of > priorities) decided to return mathematically erroneous results, even > though they may be computed arithmetically accurate. ... > It's not about how many decimal places of arithmetic accuracy being > represented, it's a matter of conceptual accuracy that the language > has MADE A CHOICE not to satisfy. Can you explain why you keep making the assertion that someone has made a choice to purposefully return what you deem incorrect results? Is there source code for Math.cos where you've found a condition that chooses to return 0 below a certain threshold? Or are you convinced someone made a choice based on your anecdotal results of passing in very small floating point numbers?