Initial commit
This commit is contained in:
commit
edfc5298e1
252 changed files with 93965 additions and 0 deletions
20
source/Math/Logarithm.cpp
Normal file
20
source/Math/Logarithm.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
// Logarithmic functions.
|
||||
#include <cstdlib>
|
||||
#include <Spectre/Math/Math.h>
|
||||
|
||||
namespace math {
|
||||
|
||||
#define LOG2INBASE10 0.30102999566f
|
||||
|
||||
double log(double base, double value) {
|
||||
|
||||
return log10(value) / log10(base);
|
||||
}
|
||||
|
||||
double log2(double value) {
|
||||
|
||||
return log10(value) / LOG2INBASE10;
|
||||
}
|
||||
|
||||
}; // namespace math
|
||||
Loading…
Add table
Add a link
Reference in a new issue