cos – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
(Not a bug.)
Line 1: Line 1:
== Buggy Cosinus ==
== Buggy Cosinus ==
Your signature with timestamp


This command is buggy in OFP, I hope that this will be fixed in Armed Assault.
This command is buggy in OFP, I hope that this will be fixed in Armed Assault.
Line 9: Line 10:


This leads to some problems when working with this value.
This leads to some problems when working with this value.
:This is not a bug, but a result of floating point rounding errors. Expecting any floating point calculations results to be exactly equal is bad, and leads to errors. Most often this is cared for by comparing for abs(x-y)<epsilon instead of checking x==y.  --[[User:Suma|Suma]] 17:52, 8 August 2006 (CEST)

Revision as of 16:52, 8 August 2006

Buggy Cosinus

Your signature with timestamp

This command is buggy in OFP, I hope that this will be fixed in Armed Assault.

sin 0 => 0
sin 90 => 1
cos 0 => 1
cos 90 => -4.37114e-008 !!

This leads to some problems when working with this value.

This is not a bug, but a result of floating point rounding errors. Expecting any floating point calculations results to be exactly equal is bad, and leads to errors. Most often this is cared for by comparing for abs(x-y)<epsilon instead of checking x==y. --Suma 17:52, 8 August 2006 (CEST)