summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/libmath/stubs.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-07-11 03:42:04 +0000
committerkan <kan@FreeBSD.org>2003-07-11 03:42:04 +0000
commitc7bbbdd036d3dd7ae253fb13c9994215af06f073 (patch)
treece14546aca3a67fa3440aed52f132bafaf68fe70 /contrib/libstdc++/libmath/stubs.c
parentb2a8872fbe1ec1c49094559ac7b78e6ea4ab7180 (diff)
downloadFreeBSD-src-c7bbbdd036d3dd7ae253fb13c9994215af06f073.zip
FreeBSD-src-c7bbbdd036d3dd7ae253fb13c9994215af06f073.tar.gz
Gcc 3.3.1-pre 2003-07-11 C++ support bits.
Diffstat (limited to 'contrib/libstdc++/libmath/stubs.c')
-rw-r--r--contrib/libstdc++/libmath/stubs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/libstdc++/libmath/stubs.c b/contrib/libstdc++/libmath/stubs.c
index 586fd6d..1968bff 100644
--- a/contrib/libstdc++/libmath/stubs.c
+++ b/contrib/libstdc++/libmath/stubs.c
@@ -1,6 +1,6 @@
/* Stub definitions for libmath subpart of libstdc++. */
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
@@ -108,6 +108,8 @@ float
hypotf(float x, float y)
{
float s = fabsf(x) + fabsf(y);
+ if (s == 0.0F)
+ return s;
x /= s; y /= s;
return s * sqrtf(x * x + y * y);
}
@@ -118,6 +120,8 @@ double
hypot(double x, double y)
{
double s = fabs(x) + fabs(y);
+ if (s == 0.0)
+ return s;
x /= s; y /= s;
return s * sqrt(x * x + y * y);
}
@@ -128,6 +132,8 @@ long double
hypotl(long double x, long double y)
{
long double s = fabsl(x) + fabsl(y);
+ if (s == 0.0L)
+ return s;
x /= s; y /= s;
return s * sqrtl(x * x + y * y);
}
OpenPOWER on IntegriCloud