godot/core/math
Hein-Pieter van Braam b696beea65 Correct hash behavior for floating point numbers
This fixes HashMap where a key or part of a key is a floating point
number. To fix this the following has been done:

* HashMap now takes an extra template argument Comparator. This class
gets used to compare keys. The default Comperator now works correctly
for common types and floating point numbets.

* Variant implements ::hash_compare() now. This function implements
nan-safe comparison for all types with components that contain floating
point numbers.

* Variant now has a VariantComparator which uses Variant::hash_compare()
safely compare floating point components of variant's types.

* The hash functions for floating point numbers will now normalize NaN
values so that all floating point numbers that are NaN hash to the same
value.

C++ module writers that want to use HashMap internally in their modules
can now also safeguard against this crash by defining their on
Comperator class that safely compares their types.

GDScript users, or writers of modules that don't use HashMap internally
in their modules don't need to do anything.

This fixes #7354 and fixes #6947.
2017-02-16 18:44:29 +01:00
..
a_star.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
a_star.h Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
audio_frame.cpp Oops! Audio engine has vanished :D 2017-01-15 16:07:51 -03:00
audio_frame.h WIP new AudioServer, with buses, effects, etc. 2017-01-21 19:01:00 -03:00
bsp_tree.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
bsp_tree.h Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
camera_matrix.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
camera_matrix.h Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
face3.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
face3.h Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
geometry.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
geometry.h Many fixes to make exported scenes work better, still buggy. 2017-02-15 08:34:02 -03:00
math_2d.cpp Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
math_2d.h Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
math_defs.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
math_funcs.cpp Merge pull request #7528 from tagcup/real_t_float_fixes 2017-01-20 19:24:49 -03:00
math_funcs.h Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
matrix3.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
matrix3.h Type renames: 2017-01-11 00:52:51 -03:00
octree.h Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
pcg.cpp Replace the existing PRNG (Xorshift31) with (minimal) PCG (XSH-RR variant with 32-bit output, 64-bit state). 2017-01-15 19:15:16 -06:00
pcg.h Replace the existing PRNG (Xorshift31) with (minimal) PCG (XSH-RR variant with 32-bit output, 64-bit state). 2017-01-15 19:15:16 -06:00
plane.cpp Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
plane.h Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
quat.cpp Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
quat.h Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
quick_hull.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
quick_hull.h Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
rect3.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
rect3.h Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
SCsub style: Fix PEP8 whitespace issues in Python files 2016-11-01 00:35:16 +01:00
transform.cpp Type renames: 2017-01-11 00:52:51 -03:00
transform.h Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
triangle_mesh.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
triangle_mesh.h Type renames: 2017-01-11 00:52:51 -03:00
triangulate.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
triangulate.h Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
triangulator.cpp Style: Fix whole-line commented code 2017-01-14 14:52:23 +01:00
triangulator.h begin new serialization framework 2015-02-15 01:21:26 -03:00
vector3.cpp Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
vector3.h Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00