mirror of
https://github.com/nzp-team/quakec.git
synced 2025-01-31 13:40:52 +00:00
SERVER: Add exp math function
This commit is contained in:
parent
fa0a85fce0
commit
297ab1bfee
1 changed files with 12 additions and 0 deletions
|
@ -76,6 +76,18 @@ float(float x) sign = {
|
|||
return 0;
|
||||
};
|
||||
|
||||
float exp(float x) {
|
||||
float result = 1;
|
||||
float term = 1;
|
||||
|
||||
for (float i = 1; i < 50; i++) {
|
||||
term *= x / i;
|
||||
result += term;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* wrap
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue