/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/sgx/core/math/math.cpp

*/

#include "sgx/core/types/types.hpp"
#include "sgx/core/math/math.hpp"

/**
The maths library consists of separate classes for each type of structure.

This includes:
@sgxMatrix43
@sgxMatrix44
@sgxVector2
@sgxVector3
@sgxVector4

Along with a set of "numerics" (basic math functions using only atomic types,
like float and integer) and trigonometer (sine/cosine/etc).

As far as possible, each vector class has the same set of operators.
*/

#if 0
tBOOL 
baseConvert(tINT32 &result, const tUINT32 targetBase, const tINT32 sourceValue, const tUINT32 sourceValueBase=10) {
	tINT32 base10 = 0;
	tBOOL neg = sourceValue < 0 : TRUE : FALSE;
	tINT32 working = sourceValue < 0 : -sourceValue : sourceValue;

	// Convert to base 10
	// (10 chosen because, despite being arbitrary, is known to most programmers :)

	base10 = 0;
	tUINT32 mul = 1;
	while(working) {
		// The process is:
		// + strip LSB
		tUINT32 lsb = working % sourceValueBase;
		base10 += lsb;
		// + shift down
		working /= sourceValueBase;
		// + change multiplier
		mul *= sourceValueBase;
	}

	// Now convert into targetBase


	return TRUE;
}
#endif
