1 /* s_rintf.c -- float version of s_rint.c.
5 * ====================================================
6 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 * Developed at SunPro, a Sun Microsystems, Inc. business.
9 * Permission to use, copy, modify, and distribute this
10 * software is freely granted, provided that this notice
12 * ====================================================
15 #define NO_MATH_REDIRECT
17 #include <math_private.h>
18 #include <libm-alias-float.h>
19 #include <math-use-builtins.h>
25 return __builtin_rintf (x
);
27 /* Use generic implementation. */
30 8.3886080000e+06, /* 0x4b000000 */
31 -8.3886080000e+06, /* 0xcb000000 */
35 GET_FLOAT_WORD (i0
, x
);
37 j0
= ((i0
>> 23) & 0xff) - 0x7f;
44 GET_FLOAT_WORD (i0
, t
);
45 SET_FLOAT_WORD (t
, (i0
& 0x7fffffff) | (sx
<< 31));
52 return x
+ x
; /* inf or NaN */
54 return x
; /* x is integral */
58 #endif /* ! USE_RINTF_BUILTIN */
61 libm_alias_float (__rint
, rint
)