[Gambas-user] Sin(Rad(180)) = ?

Tobias Boege tobs at taboege.de
Fri Apr 16 16:15:26 CEST 2021


On Fri, 16 Apr 2021, vuott--- via User wrote:
> Hello,
> excuse me, if I'm not mistaken, the sine of 180° = 0.
> 
>    https://en.wikipedia.org/wiki/Sine#Properties_relating_to_the_quadrants
> 
> But in Gambas with this:
> 
>    Sin(Rad(180.0))   I obtain: 1.22464679914735E-16
> 
> Why ?
> 

Rounding errors. Notice that 1.2246E-16 = 0.00000000000000012246.
This is very close to zero. Small errors happen with the limited
precision of IEEE754 floating point numbers.

Best,
Tobias

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list