_PROTOTYPE( double log10, (double _x) );
_PROTOTYPE( double modf, (double _x, double *_iptr) );
_PROTOTYPE( double pow, (double _x, double _y) );
+_PROTOTYPE( double rint, (double _x) );
_PROTOTYPE( double sin, (double _x) );
_PROTOTYPE( double sinh, (double _x) );
_PROTOTYPE( double sqrt, (double _x) );
log.c \
log10.c \
pow.c \
+ s_rint.c \
sin.c \
sinh.c \
sqrt.c \
#define _MATH_PRIVATE_H_
#include <sys/types.h>
-#include <machine/endian.h>
+#include <net/hton.h>
/*
* The original fdlibm code used statements like:
* ints.
*/
-#if BYTE_ORDER == BIG_ENDIAN
+#if BIG_ENDIAN
typedef union
{
double value;
struct
{
- u_int32_t msw;
- u_int32_t lsw;
+ u32_t msw;
+ u32_t lsw;
} parts;
} ieee_double_shape_type;
#endif
-#if BYTE_ORDER == LITTLE_ENDIAN
+#if LITTLE_ENDIAN
typedef union
{
double value;
struct
{
- u_int32_t lsw;
- u_int32_t msw;
+ u32_t lsw;
+ u32_t msw;
} parts;
} ieee_double_shape_type;
(d) = sf_u.value; \
} while (0)
+#if 0
+
#ifdef _COMPLEX_H
/*
* Inline functions that can be used to construct complex values.
float __kernel_tandf(double,int);
int __kernel_rem_pio2f(float*,float*,int,int,int,const int*);
+#endif
+
#endif /* !_MATH_PRIVATE_H_ */
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_rint.c,v 1.11.2.1 2007/06/14 05:16:44 bde Exp $";
-#endif
-
/*
* rint(x)
* Return x rounded to integral value according to the prevailing
* Inexact flag raised if x not equal to rint(x).
*/
-#include "math.h"
#include "math_private.h"
static const double
double
rint(double x)
{
- int32_t i0,j0,sx;
- u_int32_t i,i1;
+ i32_t i0,j0,sx;
+ u32_t i,i1;
double w,t;
EXTRACT_WORDS(i0,i1,x);
sx = (i0>>31)&1;
if(j0==0x400) return x+x; /* inf or NaN */
else return x; /* x is integral */
} else {
- i = ((u_int32_t)(0xffffffff))>>(j0-20);
+ i = ((u32_t)(0xffffffff))>>(j0-20);
if((i1&i)==0) return x; /* x is integral */
i>>=1;
if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20));