On Dec 23, 12:35*pm, jzakiya <(E-Mail Removed)> wrote:

> Dear Matz,

>

> I use a Linux calculator named Qaculate.

> I do not know the people who designed and

> coded it, but it makes me happy. Why?

>

> When I put in sin(180) it outputs '0'

> not 1.22460635382238e-16, and when I change

> to radians for angles and do sin(PI) it

> also gives '0' and not 1.22460635382238e-16.

>

> This makes me happy.

>

> In fact, this little Linux calculator produces

> all the correct (exact) answers for angles on

> an axis for both cos and sin, whether you input

> the angles in degrees or radians. Astonishing!!

>

> I don't now anything about how the people who

> designed and implemented Qalculate decided to

> use whatever language they chose to write it in,

> or what libraries they decided to use. I don't

> know (or care) about any of those under-the-hood

> things.

>

> What I do KNOW is that the people who designed and

> implemented this calculator CARED that it produced

> the mathematically exact results for those angles.

>

> This makes me happy.
Perhaps you should look under the hood to see what its doing.

>

> I use another add-on calculator for Firefox, called,

> tada! Calculator. Again, I don't know the people who

> designed and/or coded it, and I don't know what

> language or libraries they used to do it in either.

> But when I use this little calculator in Firefox I do

> know I get sin(PI) = 0, not 1.22460635382238e-16.

>

> So, for this calculator too, somebody(s) CARED enough

> to make sure the answers came out correctly (exact)

> for angles on an axis too. So when I use this calculator,

>

> This makes me happy.
***PURE*** speculation, but this sounds like its just rounding off the

results for a pretty display for the end user. (Again, look at the

source)

>

> I think Ruby is a Great language, and a fun language.

> And I agree with your philosophy that languages that

> people use should serve them, not the other way around.

>

> So I humbly tell you I am Surprised that Ruby produces

> the math errors I've illustrated in this thread, and

>

> This makes me unhappy.

>

> So I am asking you to see that these errors be fixed.

>

> If Qaculator and Calculator can produce the correct

> results, then so can Ruby. All that is necessary is that

> you CARE enough that it does it.

>

> It would make me very happy if I could share my code, and

> not have to include patches and redefinitions in it just

> to assure other people get the same (exact) results I do.

>

> I agree with your Principle of Least Surprises (POLS).

>

> The language should work to please the user.

> The language should be intuitive to the user.

> The language should not cause unnecessary surprises.

>

> So please, fix these errors.

>

> This will make me happy.

>

> Thanks
This has already been explained. The ratio of a circle's circumference

to its diameter cannot be fully actualized in finite bytes (and

certainly not in floats). Calculations using Math:

I, therefor,

unless given a special representation, and the language/library has

been built from the ground up to handle calculations with that special

representation (and similarly with all other sorts of irrational

numbers) will never yield a 100% result. If you need more precision

than floating point arithmatic provides, use a specialized language.

If you want your values that, for you, are sufficiently close to zero

to be zero, then its easy enough to round them. However, that decision

****CANNOT**** be made for everybody using the language, as different

people have different expectations of precision, and as has been

mentioned before libraries will break.