Maths Namespace Reference


Detailed Description

Defines a set of tools for maths.

In the FX::Maths namespace are a number of assorted tools for performing maths operations. Each is optimised for as much inline generation as possible via metaprogramming, as well as making use of any specialised vector hardware on your processor.

Typically on x86, your compiler will use x87 floating point operations. When SSE1 is available, it will use SSE1 ops for float operations and when SSE2 is available, it will use SSE2 for both float and double operations. You will typically see a 25% increase in performance with SSE2 over x87, and a further 250-400% increase when using SSE optimised vectors via FX::Maths::Vector. The Vector implementation is future proof, so writing your code with it now will be exponentially faster again on newer technology using GPU-like parallel processing.

Much like FX::Generic::BiggestValue and FX::Generic::SmallestValue, we have here FX::Maths::InfinityValue and FX::Maths::NaNValue. This solves a major problem of specifying these values as constants in C++ as both have very useful properties when working in floating point numbers - for example, if you have a floating point number which is invalid, you should set it to NaN so any operations with it will propagate the NaN, thereby catching the misuse.


(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:30:29 2008 for TnFOX by doxygen v1.5.6