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

Subversion Repositories or1k

[/] [or1k/] [branches/] [newlib/] [newlib/] [newlib/] [libm/] [math/] [w_remainder.c] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 11... Line 11...
 * ====================================================
 * ====================================================
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
<<rint>>, <<rintf>>, <<remainder>>, <<remainderf>>---round and  remainder
<<remainder>>, <<remainderf>>---round and  remainder
INDEX
 
        rint
 
INDEX
 
        rintf
 
INDEX
INDEX
        remainder
        remainder
INDEX
INDEX
        remainderf
        remainderf
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <math.h>
        #include <math.h>
        double rint(double <[x]>);
 
        float rintf(float <[x]>);
 
        double remainder(double <[x]>, double <[y]>);
        double remainder(double <[x]>, double <[y]>);
        float remainderf(float <[x]>, float <[y]>);
        float remainderf(float <[x]>, float <[y]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <math.h>
        #include <math.h>
        double rint(<[x]>)
 
        double <[x]>;
 
        float rintf(<[x]>)
 
        float <[x]>;
 
        double remainder(<[x]>,<[y]>)
        double remainder(<[x]>,<[y]>)
        double <[x]>, <[y]>;
        double <[x]>, <[y]>;
        float remainderf(<[x]>,<[y]>)
        float remainderf(<[x]>,<[y]>)
        float <[x]>, <[y]>;
        float <[x]>, <[y]>;
 
 
DESCRIPTION
DESCRIPTION
<<rint>> and <<rintf>> returns their argument rounded to the nearest
<<remainder>> and <<remainderf>> find the remainder of
integer.  <<remainder>> and <<remainderf>> find the remainder of
 
<[x]>/<[y]>; this value is in the range -<[y]>/2 .. +<[y]>/2.
<[x]>/<[y]>; this value is in the range -<[y]>/2 .. +<[y]>/2.
 
 
RETURNS
RETURNS
<<rint>> and <<remainder>> return the integer result as a double.
<<remainder>> returns the integer result as a double.
 
 
PORTABILITY
PORTABILITY
<<rint>> and <<remainder>> are System V release 4.  <<rintf>> and
<<remainder>> is a System V release 4.
<<remainderf>> are extensions.
<<remainderf>> is an extension.
 
 
*/
*/
 
 
/*
/*
 * wrapper remainder(x,p)
 * wrapper remainder(x,p)
Line 80... Line 69...
        if(_LIB_VERSION == _IEEE_ || isnan(y)) return z;
        if(_LIB_VERSION == _IEEE_ || isnan(y)) return z;
        if(y==0.0) {
        if(y==0.0) {
            /* remainder(x,0) */
            /* remainder(x,0) */
            exc.type = DOMAIN;
            exc.type = DOMAIN;
            exc.name = "remainder";
            exc.name = "remainder";
 
            exc.err = 0;
 
            exc.arg1 = x;
 
            exc.arg2 = y;
            exc.retval = 0.0/0.0;
            exc.retval = 0.0/0.0;
            if (_LIB_VERSION == _POSIX_)
            if (_LIB_VERSION == _POSIX_)
               errno = EDOM;
               errno = EDOM;
            else if (!matherr(&exc)) {
            else if (!matherr(&exc)) {
               errno = EDOM;
               errno = EDOM;

powered by: WebSVN 2.1.0

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