OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libm/] [common/] [s_isnand.c] - Diff between revs 207 and 345

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

Rev 207 Rev 345
/*
/*
 * ====================================================
 * ====================================================
 * 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.
 * ====================================================
 * ====================================================
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
        <<isnan>>, <<isnanf>>, <<isinf>>, <<isinff>>, <<finite>>, <<finitef>>---test for exceptional numbers
        <<isnan>>, <<isnanf>>, <<isinf>>, <<isinff>>, <<finite>>, <<finitef>>---test for exceptional numbers
 
 
INDEX
INDEX
        isnan
        isnan
INDEX
INDEX
        isinf
        isinf
INDEX
INDEX
        finite
        finite
 
 
INDEX
INDEX
        isnanf
        isnanf
INDEX
INDEX
        isinff
        isinff
INDEX
INDEX
        finitef
        finitef
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <ieeefp.h>
        #include <ieeefp.h>
        int isnan(double <[arg]>);
        int isnan(double <[arg]>);
        int isinf(double <[arg]>);
        int isinf(double <[arg]>);
        int finite(double <[arg]>);
        int finite(double <[arg]>);
        int isnanf(float <[arg]>);
        int isnanf(float <[arg]>);
        int isinff(float <[arg]>);
        int isinff(float <[arg]>);
        int finitef(float <[arg]>);
        int finitef(float <[arg]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <ieeefp.h>
        #include <ieeefp.h>
        int isnan(<[arg]>)
        int isnan(<[arg]>)
        double <[arg]>;
        double <[arg]>;
        int isinf(<[arg]>)
        int isinf(<[arg]>)
        double <[arg]>;
        double <[arg]>;
        int finite(<[arg]>);
        int finite(<[arg]>);
        double <[arg]>;
        double <[arg]>;
        int isnanf(<[arg]>);
        int isnanf(<[arg]>);
        float <[arg]>;
        float <[arg]>;
        int isinff(<[arg]>);
        int isinff(<[arg]>);
        float <[arg]>;
        float <[arg]>;
        int finitef(<[arg]>);
        int finitef(<[arg]>);
        float <[arg]>;
        float <[arg]>;
 
 
 
 
DESCRIPTION
DESCRIPTION
        These functions provide information on the floating-point
        These functions provide information on the floating-point
        argument supplied.
        argument supplied.
 
 
        There are five major number formats:
        There are five major number formats:
        o+
        o+
        o zero
        o zero
          A number which contains all zero bits.
          A number which contains all zero bits.
        o subnormal
        o subnormal
          A number with a zero exponent but a nonzero fraction.
          A number with a zero exponent but a nonzero fraction.
        o normal
        o normal
          A number with an exponent and a fraction.
          A number with an exponent and a fraction.
        o infinity
        o infinity
          A number with an all 1's exponent and a zero fraction.
          A number with an all 1's exponent and a zero fraction.
        o NAN
        o NAN
          A number with an all 1's exponent and a nonzero fraction.
          A number with an all 1's exponent and a nonzero fraction.
 
 
        o-
        o-
 
 
        <<isnan>> returns 1 if the argument is a nan. <<isinf>>
        <<isnan>> returns 1 if the argument is a nan. <<isinf>>
        returns 1 if the argument is infinity.  <<finite>> returns 1 if the
        returns 1 if the argument is infinity.  <<finite>> returns 1 if the
        argument is zero, subnormal or normal.
        argument is zero, subnormal or normal.
 
 
        Note that by the C99 standard, <<isnan>> and <<isinf>> are macros
        Note that by the C99 standard, <<isnan>> and <<isinf>> are macros
        taking any type of floating-point and are declared in
        taking any type of floating-point and are declared in
        <<math.h>>.  Newlib has chosen to declare these as macros in
        <<math.h>>.  Newlib has chosen to declare these as macros in
        <<math.h>> and as functions in <<ieeefp.h>>.
        <<math.h>> and as functions in <<ieeefp.h>>.
 
 
        The <<isnanf>>, <<isinff>> and <<finitef>> functions perform the same
        The <<isnanf>>, <<isinff>> and <<finitef>> functions perform the same
        operations as their <<isnan>>, <<isinf>> and <<finite>>
        operations as their <<isnan>>, <<isinf>> and <<finite>>
        counterparts, but on single-precision floating-point numbers.
        counterparts, but on single-precision floating-point numbers.
 
 
QUICKREF
QUICKREF
        isnan - pure
        isnan - pure
QUICKREF
QUICKREF
        isinf - pure
        isinf - pure
QUICKREF
QUICKREF
        finite - pure
        finite - pure
QUICKREF
QUICKREF
        isnan - pure
        isnan - pure
QUICKREF
QUICKREF
        isinf - pure
        isinf - pure
QUICKREF
QUICKREF
        finite - pure
        finite - pure
*/
*/
 
 
/*
/*
 * __isnand(x) returns 1 is x is nan, else 0;
 * __isnand(x) returns 1 is x is nan, else 0;
 * no branching!
 * no branching!
 */
 */
 
 
#include "fdlibm.h"
#include "fdlibm.h"
 
 
#ifndef _DOUBLE_IS_32BITS
#ifndef _DOUBLE_IS_32BITS
 
 
int
int
_DEFUN (__isnand, (x),
_DEFUN (__isnand, (x),
        double x)
        double x)
{
{
        __int32_t hx,lx;
        __int32_t hx,lx;
        EXTRACT_WORDS(hx,lx,x);
        EXTRACT_WORDS(hx,lx,x);
        hx &= 0x7fffffff;
        hx &= 0x7fffffff;
        hx |= (__uint32_t)(lx|(-lx))>>31;
        hx |= (__uint32_t)(lx|(-lx))>>31;
        hx = 0x7ff00000 - hx;
        hx = 0x7ff00000 - hx;
        return (int)(((__uint32_t)(hx))>>31);
        return (int)(((__uint32_t)(hx))>>31);
}
}
 
 
#endif /* _DOUBLE_IS_32BITS */
#endif /* _DOUBLE_IS_32BITS */
 
 

powered by: WebSVN 2.1.0

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