OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libm/] [common/] [sf_isnan.c] - Diff between revs 148 and 158

Only display areas with differences | Details | Blame | View Log

Rev 148 Rev 158
/* sf_c_isnan.c -- float version of s_c_isnan.c.
/* sf_c_isnan.c -- float version of s_c_isnan.c.
 */
 */
 
 
/*
/*
 * ====================================================
 * ====================================================
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 *
 *
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Permission to use, copy, modify, and distribute this
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice
 * software is freely granted, provided that this notice
 * is preserved.
 * is preserved.
 * ====================================================
 * ====================================================
 */
 */
 
 
/*
/*
 * isnanf(x) returns 1 is x is nan, else 0;
 * isnanf(x) returns 1 is x is nan, else 0;
 *
 *
 * isnanf is an extension declared in <ieeefp.h> and <math.h>.
 * isnanf is an extension declared in <ieeefp.h> and <math.h>.
 */
 */
 
 
#include "fdlibm.h"
#include "fdlibm.h"
 
 
int
int
_DEFUN (isnanf, (x),
_DEFUN (isnanf, (x),
        float x)
        float x)
{
{
        __int32_t ix;
        __int32_t ix;
        GET_FLOAT_WORD(ix,x);
        GET_FLOAT_WORD(ix,x);
        ix &= 0x7fffffff;
        ix &= 0x7fffffff;
        return FLT_UWORD_IS_NAN(ix);
        return FLT_UWORD_IS_NAN(ix);
}
}
 
 
#ifdef _DOUBLE_IS_32BITS
#ifdef _DOUBLE_IS_32BITS
 
 
#undef isnan
#undef isnan
 
 
int
int
_DEFUN (isnan, (x),
_DEFUN (isnan, (x),
        double x)
        double x)
{
{
        return isnanf((float) x);
        return isnanf((float) x);
}
}
 
 
#endif /* defined(_DOUBLE_IS_32BITS) */
#endif /* defined(_DOUBLE_IS_32BITS) */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.