Identifier '__value' changed everywhere to '__val' to avoid clashes with Microsoft...
[reactos.git] / reactos / lib / crt / math / ceil.c
1 #include <math.h>
2
3 /*
4 * @implemented
5 */
6 double ceil (double __x)
7 {
8 register double __value;
9 #ifdef __GNUC__
10 __volatile unsigned short int __cw, __cwtmp;
11
12 __asm __volatile ("fnstcw %0" : "=m" (__cw));
13 __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */
14 __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
15 __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
16 __asm __volatile ("fldcw %0" : : "m" (__cw));
17 #else
18 __value = linkme_ceil(__x);
19 #endif /*__GNUC__*/
20 return __value;
21 }