branch update for HEAD-2003021201
[reactos.git] / lib / crtdll / math / ceil.c
1 #include <msvcrt/math.h>
2
3 double ceil (double __x)
4 {
5   register double __value;
6 #ifdef __GNUC__
7   __volatile unsigned short int __cw, __cwtmp;
8
9   __asm __volatile ("fnstcw %0" : "=m" (__cw));
10   __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */
11   __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
12   __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
13   __asm __volatile ("fldcw %0" : : "m" (__cw));
14 #else
15   __value = linkme_ceil(__x);
16 #endif /*__GNUC__*/
17   return __value;
18 }
19
20
21 long double ceill (long double __x)
22 {
23         return floor(__x)+1;
24 }