[Libreoffice-bugs] [Bug 125676] Cosinus wrong value

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Jun 4 13:05:45 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=125676

--- Comment #8 from Tomaz Vajngerl <quikee at gmail.com> ---
(In reply to abra01 from comment #6)
> It was an example. An answer to @Tomaz Vajngerl that it is not correct. 
> If you put formula =sin(0) calc will return 0, but if you put formula
> =cos(pi()/2) you will get 6,12323399573677E-17

sin(0) is 0 because 0 can be represented exactly in a computer. Pi can't - it's
a irrational number and is in a computer an approximate constant to the number
of available precision of the floating point type. So then you divide that
approximation by 2 which again deviates from the true value of pi/2. Lastly cos
in computer is also a function that's computed numerically (calculating a
Taylor series if I remember correctly) and has an error. Mostly this is not
visible and pretty much irrelevant because the error is small, but sometimes
(like in this) the result is surprising, but as I said - expected.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190604/11b75419/attachment.html>


More information about the Libreoffice-bugs mailing list