Skip to content

Commit

Permalink
LibM: Add exp2() and exp2f()
Browse files Browse the repository at this point in the history
  • Loading branch information
linusg authored and awesomekling committed Jun 4, 2020
1 parent ead7637 commit c883bab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Libraries/LibM/math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ float expf(float exponent)
return (float)exp(exponent);
}

double exp2(double exponent)
{
return pow(2.0, exponent);
}

float exp2f(float exponent)
{
return pow(2.0f, exponent);
}

double cosh(double x)
{
double exponentiated = exp(-x);
Expand Down
2 changes: 2 additions & 0 deletions Libraries/LibM/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ double fmod(double, double);
float fmodf(float, float);
double exp(double);
float expf(float);
double exp2(double);
float exp2f(float);
double frexp(double, int* exp);
float frexpf(float, int* exp);
double log(double);
Expand Down

0 comments on commit c883bab

Please sign in to comment.