CALC: Cosine of 90° and sine of 180° are different from zero

An emergency exit … download a Trigonometric Table, include it in the file and make use of the information with VLOOKUP, looking for the value in the Table.

thanks for your answer.
but I think it would be easier to use GoogleSpreadsheets online. like Excel, they do not have this “bug”.

I do not see any practical difference between the value 6,12323399573677E-017 and zero, except perhaps for calculating orbital corrections for the Voyager 1 spacecraft at a distance of one or more light-years from the sun. And, given the way that computers work with numbers, I don’t see this behaviour of Calc as a “bug”.

if you are working with matrix operations with very small numbers and another very small number show up in a place where it should be zero, it might cause some trouble.

it seems that I made a mistake by saying that on Excel and on GoogleSpreadsheets they calculate the way I said. Apparently they do the same way Calc does. It is just a matter of configuration. sorry about that.

Yes, but not just matrix operations! Any place where it is necessary to calculate the difference between similar numbers (not just close to zero) can be a source of large errors. In experimental physics, these situations are a major contributor to a phenomenon known as ‘propagation of errors’.

do you know if it is possible to do cos(90) [direct in degrees - without the conversion to rad] on Calc?
Apparently when the software accepts the degree, there is no “very small=0” number issue.
It is like this on Matlab cosd and on Excel I guess (I do not have Excel here to check)

Not directly, at least in my version of LO (6.4.6.2). But there is the neat conversion function RADIANS(number of degrees) which converts degrees to radians, so you can avoid PI and just do COS(RADIANS(degrees)) …

But then, of course, if degrees = 90, the value returned by the above formula is that old problem 6.12323399573677E-17.

There is no end to it.

Check Precision as shown (choose Tools - Options… - LibreOffice Calc - Calculate).

You can show until 15 decimals, and only will see zeros.

Tested with LibreOffice 6.4.7.2 (x86); OS: Windows 6.1.


Add Answer is reserved for solutions.

Press edit below your question if you want to add more information; also can comment an answer.

Check the mark (Correct answer mark) to the left of the answer that solves your question.