source/Math/Logarithm.cpp: c++11/C99 has log2 in cmath. not sure why i didnt use it.
This commit is contained in:
parent
c1cc476094
commit
ff44ec7b7a
1 changed files with 1 additions and 3 deletions
|
|
@ -5,8 +5,6 @@
|
||||||
|
|
||||||
namespace sp {
|
namespace sp {
|
||||||
|
|
||||||
#define LOG2INBASE10 0.30102999566f
|
|
||||||
|
|
||||||
double math::log(double base, double value) {
|
double math::log(double base, double value) {
|
||||||
|
|
||||||
return ::log10(value) / ::log10(base);
|
return ::log10(value) / ::log10(base);
|
||||||
|
|
@ -14,7 +12,7 @@ double math::log(double base, double value) {
|
||||||
|
|
||||||
double math::log2(double value) {
|
double math::log2(double value) {
|
||||||
|
|
||||||
return ::log10(value) / LOG2INBASE10;
|
return ::log2(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sp
|
} // namespace sp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue