9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #pragma weak aintl = __aintl
30 #pragma weak anintl = __anintl
31 #pragma weak irintl = __irintl
32 #pragma weak nintl = __nintl
33
34 /*
35 * aintl(x) return x chopped to integral value
36 * anintl(x) return sign(x)*(|x|+0.5) chopped to integral value
37 * irintl(x) return rint(x) in integer format
38 * nintl(x) return anint(x) in integer format
39 *
40 * NOTE: aintl(x), anintl(x), ceill(x), floorl(x), and rintl(x) return result
41 * with the same sign as x's, including 0.0.
42 */
43
44 #include "libm.h"
45 #include "longdouble.h"
46
47 extern enum fp_direction_type __swapRD(enum fp_direction_type);
48
49 static const long double qone = 1.0L, qhalf = 0.5L, qmhalf = -0.5L;
50
51 long double
52 aintl(long double x) {
53 long double t, w;
|
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 /*
30 * aintl(x) return x chopped to integral value
31 * anintl(x) return sign(x)*(|x|+0.5) chopped to integral value
32 * irintl(x) return rint(x) in integer format
33 * nintl(x) return anint(x) in integer format
34 *
35 * NOTE: aintl(x), anintl(x), ceill(x), floorl(x), and rintl(x) return result
36 * with the same sign as x's, including 0.0.
37 */
38
39 #include "libm.h"
40 #include "longdouble.h"
41
42 extern enum fp_direction_type __swapRD(enum fp_direction_type);
43
44 static const long double qone = 1.0L, qhalf = 0.5L, qmhalf = -0.5L;
45
46 long double
47 aintl(long double x) {
48 long double t, w;
|