mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-09 17:52:08 -10:00
Floating-point comparisons are tricky beasts. See this article for a good summary of the issues involved: https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ This PR improves support somewhat, although there are obviously situations in the code (such as comparisons to 0) that should still be addressed. This PR makes the following improvements: 1) Tightens the threshold on `IS_VEC_NULL` and `IS_VEC_NULL_SQ_SAFE` from 1e-16 and 1e-36 to FLT_EPSILON 2) Tightens the threshold for parsing `turn_time` in POFs 3) Restores the previous implementation of `fl_equal` 4) Adds a dedicated `IS_MOI_VEC_NULL` for moment of inertia values 5) Improves documentation Follow-up to #4535 and #4443.