mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
- Implemented MSVC version of exp
svn path=/trunk/; revision=42843
This commit is contained in:
parent
9a06e2badb
commit
ecc5d7ef19
|
@ -42,6 +42,22 @@ double exp (double __x)
|
|||
|
||||
return __value;
|
||||
#else
|
||||
#error IMPLEMENT ME
|
||||
register double __val;
|
||||
__asm
|
||||
{
|
||||
fld1 // store 1.0 for later use
|
||||
fld __x
|
||||
fldl2e // e^x = 2^(x * log2(e))
|
||||
fmul st,st(1) // x * log2(e)
|
||||
fld st(0)
|
||||
frndint // int(x * log2(e))
|
||||
fsub st,st(1) // fract(x * log2(e))
|
||||
fxch
|
||||
f2xm1 // 2^(fract(x * log2(e))) - 1
|
||||
fadd st,st(3) // + 1.0
|
||||
fscale
|
||||
fstp __val
|
||||
}
|
||||
return __val;
|
||||
#endif /*__GNUC__*/
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue