#include "MyMath.h"

float log2(float x)
{
	static float one_over_log10_2= 1.0 / log10(2.0);

	return log10(x)*one_over_log10_2;
}

float degToRad(float angleDeg)
{
	static float  one_div_180 =1.0/180.0;
	return angleDeg *DT_PI*one_div_180;
}

float radToDeg(float angleRad)
{
	static float  one_div_2PI =1.0/(2*DT_PI);
	return angleRad * 360 * one_div_2PI;
}

float getRandomNumberFrom0To1( void )
{
	float num = rand() % RAND_MAX;
	return  num /  float(RAND_MAX) ;
}
/*
float getRandomNumberFrom0To1( unsigned int seed )
{
	srand( seed );
	float num = rand() % RAND_MAX;
	return  num /  float(RAND_MAX) ;
}
*/