URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 148 |
Rev 158 |
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
|
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
|
*
|
*
|
* Permission to use, copy, modify, and distribute this software
|
* Permission to use, copy, modify, and distribute this software
|
* is freely granted, provided that this notice is preserved.
|
* is freely granted, provided that this notice is preserved.
|
*/
|
*/
|
|
|
#include "fdlibm.h"
|
#include "fdlibm.h"
|
|
|
#ifdef __STDC__
|
#ifdef __STDC__
|
float fdimf(float x, float y)
|
float fdimf(float x, float y)
|
#else
|
#else
|
float fdimf(x,y)
|
float fdimf(x,y)
|
float x;
|
float x;
|
float y;
|
float y;
|
#endif
|
#endif
|
{
|
{
|
int c = __fpclassifyf(x);
|
int c = __fpclassifyf(x);
|
if (c == FP_NAN || c == FP_INFINITE)
|
if (c == FP_NAN || c == FP_INFINITE)
|
return HUGE_VAL;
|
return HUGE_VAL;
|
|
|
return x > y ? x - y : 0.0;
|
return x > y ? x - y : 0.0;
|
}
|
}
|
|
|
#ifdef _DOUBLE_IS_32BITS
|
#ifdef _DOUBLE_IS_32BITS
|
|
|
#ifdef __STDC__
|
#ifdef __STDC__
|
double fdim(double x, double y)
|
double fdim(double x, double y)
|
#else
|
#else
|
double fdim(x,y)
|
double fdim(x,y)
|
double x;
|
double x;
|
double y;
|
double y;
|
#endif
|
#endif
|
{
|
{
|
return (double) fdimf((float) x, (float) y);
|
return (double) fdimf((float) x, (float) y);
|
}
|
}
|
|
|
#endif /* defined(_DOUBLE_IS_32BITS) */
|
#endif /* defined(_DOUBLE_IS_32BITS) */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.