re PR libfortran/15292 (libgfortran depends on c99 functionality round and roundf)
2004-06-14 Bud Davis <bdavis9659@comcast.net> PR gfortran/15292 * intrinsics/c99_functions.c: Use fpclassify if it exists. From-SVN: r83116
This commit is contained in:
parent
ce738b86f9
commit
bc20e36d16
|
@ -1,3 +1,8 @@
|
||||||
|
2004-06-14 Bud Davis <bdavis9659@comcast.net>
|
||||||
|
|
||||||
|
PR gfortran/15292
|
||||||
|
* intrinsics/c99_functions.c: Use fpclassify if it exists.
|
||||||
|
|
||||||
2004-06-13 Paul Brook <paul@codesourcery.com>
|
2004-06-13 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
* Makefile.am (gfor_helper_src): Add runtime/normalize.f90.
|
* Makefile.am (gfor_helper_src): Add runtime/normalize.f90.
|
||||||
|
|
|
@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
|
||||||
#include "libgfortran.h"
|
#include "libgfortran.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* Note that if HAVE_FPCLASSIFY is not defined, then NaN is not handled */
|
||||||
|
|
||||||
/* Algorithm by Steven G. Kargl. */
|
/* Algorithm by Steven G. Kargl. */
|
||||||
|
|
||||||
#ifndef HAVE_ROUND
|
#ifndef HAVE_ROUND
|
||||||
|
@ -34,11 +36,12 @@ double
|
||||||
round(double x)
|
round(double x)
|
||||||
{
|
{
|
||||||
double t;
|
double t;
|
||||||
|
#ifdef HAVE_FPCLASSIFY
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = fpclassify(x);
|
i = fpclassify(x);
|
||||||
if (i == FP_INFINITE || i == FP_NAN)
|
if (i == FP_INFINITE || i == FP_NAN)
|
||||||
return (x);
|
return (x);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (x >= 0.0)
|
if (x >= 0.0)
|
||||||
{
|
{
|
||||||
|
@ -65,11 +68,13 @@ float
|
||||||
roundf(float x)
|
roundf(float x)
|
||||||
{
|
{
|
||||||
float t;
|
float t;
|
||||||
|
#ifdef HAVE_FPCLASSIFY
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = fpclassify(x);
|
i = fpclassify(x);
|
||||||
if (i == FP_INFINITE || i == FP_NAN)
|
if (i == FP_INFINITE || i == FP_NAN)
|
||||||
return (x);
|
return (x);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (x >= 0.0)
|
if (x >= 0.0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue