diff options
| author | Hein-Pieter van Braam | 2017-02-14 04:10:02 +0100 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2017-02-14 13:32:23 +0100 |
| commit | adcc211feb7827127b2548c791f2de0b6efda3d3 (patch) | |
| tree | 8bb33b592e3d3982ca5faf5e041c37644d5b525d /core/math/quat.h | |
| parent | 81edda18f39efc4f783bc6fa2b381c01cfc0ef2d (diff) | |
| download | godot-adcc211feb7827127b2548c791f2de0b6efda3d3.tar.gz godot-adcc211feb7827127b2548c791f2de0b6efda3d3.tar.zst godot-adcc211feb7827127b2548c791f2de0b6efda3d3.zip | |
Make nan==nan true for GDScript
After discussing this with Reduz this seemed like the best way to
fix #7354. This will make composite values that contain NaN in the same
places as well as the same other values compare as the same.
Additionally non-composite values now also compare equal if they are
both NaN. This breaks IEEE specifications but this is probably what most
users expect. There is a GDScript function check for NaN if the user
needs this information.
This fixes #7354 and probably also fixes #6947
Diffstat (limited to 'core/math/quat.h')
| -rw-r--r-- | core/math/quat.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/quat.h b/core/math/quat.h index d3a50343a..5d91bb1d3 100644 --- a/core/math/quat.h +++ b/core/math/quat.h @@ -93,6 +93,7 @@ public: _FORCE_INLINE_ Quat operator*(const real_t& s) const; _FORCE_INLINE_ Quat operator/(const real_t& s) const; + bool nan_equals(const Quat& q2) const; _FORCE_INLINE_ bool operator==(const Quat& p_quat) const; _FORCE_INLINE_ bool operator!=(const Quat& p_quat) const; @@ -193,5 +194,4 @@ bool Quat::operator!=(const Quat& p_quat) const { return x!=p_quat.x || y!=p_quat.y || z!=p_quat.z || w!=p_quat.w; } - #endif |
