Using std::numeric_limits for the Double variants looks like an overkill
to me, but there apparently isn't any other way, except for crafting the
value manually using the exact binary representation (and hoping it will
be portable) or producing the value as result of division by zero or
something like that (and then working around the warnings and also
hoping it will be portable).
Constants::piHalf() is not longer to write than doing the division
manually and it has significantly smaller mental overhead. Also I chose
piHalf() instead of halfPi() to make it more discoverable through
autocompletion.
Float a = Constants::pi()*0.5f;
Float a = Constants::piHalf();
Float b = Constants::pi()/(2*countOfSomething);
Float b = Constants::piHalf()/countOfSomething;
The only places where they aren't absolute are:
- when header is included from corresponding source file
- when including headers which are not part of final installation (e.g.
test-specific configuration, headers from Implementation/)
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.
Magnum.h now doesn't include anything except OpenGL headers, thus
changes in Math library don't trigger recompilation of everything, but
only of things really depending on it.
Math constants moved to separate file for similar reasons, de-inlined
some functions to remove the need for some #includes.