// Copyright (C) 2013 Jérôme Leclercq // This file is part of the "Nazara Engine - Mathematics module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_BASIC_HPP #define NAZARA_BASIC_HPP #include #include #include #ifndef M_PI #define M_PI 3.141592653589793238462643 #endif #ifndef M_SQRT2 #define M_SQRT2 1.4142135623730950488016887 #endif template T NzApproach(T value, T objective, T increment); template T NzClamp(T value, T min, T max); template T NzDegrees(T degrees); template T NzDegreeToRadian(T degrees); inline unsigned int NzIntegralPow(unsigned int base, unsigned int exponent); inline unsigned int NzGetNumberLength(signed char number); inline unsigned int NzGetNumberLength(unsigned char number); inline unsigned int NzGetNumberLength(int number); inline unsigned int NzGetNumberLength(unsigned int number); inline unsigned int NzGetNumberLength(long long number); inline unsigned int NzGetNumberLength(unsigned long long number); inline unsigned int NzGetNumberLength(float number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION); inline unsigned int NzGetNumberLength(double number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION); inline unsigned int NzGetNumberLength(long double number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION); template T NzLerp(T from, T to, T2 interpolation); template T NzNormalizeAngle(T angle); template bool NzNumberEquals(T a, T b); inline NzString NzNumberToString(long long number, nzUInt8 radix = 10); template T NzRadians(T radians); template T NzRadianToDegree(T radians); inline long long NzStringToNumber(NzString str, nzUInt8 radix = 10, bool* ok = nullptr); #include #endif // NAZARA_BASIC_HPP