ReactOS 0.4.15-dev-7924-g5949c20
ldexp.c File Reference
#include <precomp.h>
Include dependency graph for ldexp.c:

Go to the source code of this file.

Functions

double ldexp (double value, int exp)
 

Function Documentation

◆ ldexp()

double ldexp ( double  value,
int  exp 
)

Definition at line 12 of file ldexp.c.

13{
14#ifdef __GNUC__
15 register double result;
16#endif
17
18 /* Check for value correctness
19 * and set errno if required
20 */
21 if (_isnan(value))
22 {
23 errno = EDOM;
24 }
25
26#ifdef __GNUC__
27 asm ("fscale"
28 : "=t" (result)
29 : "0" (value), "u" ((double)exp)
30 : "1");
31 return result;
32#else /* !__GNUC__ */
33 __asm
34 {
35 fild exp
36 fld value
37 fscale
38 fstp st(1)
39 }
40
41 /* "fstp st(1)" has copied st(0) to st(1), then popped the FPU stack,
42 * so that the value is again in st(0) now. Effectively, we have reduced
43 * the FPU stack by one element while preserving st(0).
44 * st(0) is also the register used for returning a double value. */
45#endif /* !__GNUC__ */
46}
#define EDOM
Definition: errno.h:39
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _isnan(_In_ double)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
DWORD exp
Definition: msg.c:16058
#define errno
Definition: errno.h:18
Definition: pdh_main.c:94