3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Implements the ldexp CRT function for IA-32 with Windows-compatible error codes.
5 * COPYRIGHT: Copyright 2010 Timo Kreuzer (timo.kreuzer@reactos.org)
6 * Copyright 2011 Pierre Schweitzer (pierre@reactos.org)
7 * Copyright 2019 Colin Finck (colin@reactos.org)
12 double ldexp (double value
, int exp
)
15 register double result
;
18 /* Check for value correctness
19 * and set errno if required
29 : "0" (value
), "u" ((double)exp
)
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__ */