Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Floating point again

Yesterday I asked a floating point question, and I have another one. I am doing some computations where I use the results of the math.h (C language) sine, cosine and tangent functions.

One of the developers muttered that you have to be careful of the return values of these functions and I should not make assumptions on the return values of the gcc math functions. I am not trying to start a discussion but I really want to know what I need to watch out for when doing computations with the standard math functions.

x

like image 735
Xofo Avatar asked Sep 09 '26 02:09

Xofo


1 Answers

You should not assume that the values returned will be consistent to high degrees of precision between different compiler/stdlib versions.

That's about it.

like image 118
Andrew Grant Avatar answered Sep 11 '26 16:09

Andrew Grant