summaryrefslogtreecommitdiff
path: root/src/math/cosh.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/cosh.c')
-rw-r--r--src/math/cosh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/math/cosh.c b/src/math/cosh.c
index 9065cd03..0f981e36 100644
--- a/src/math/cosh.c
+++ b/src/math/cosh.c
@@ -6,6 +6,12 @@
/** hyperbolic cosine **/
TYPE TGFN(cosh)(TYPE x)
{
+ switch (fpclassify(x)) {
+ case FP_ZERO: return 1.0;
+ case FP_INFINITE: return TGFN(fabs)(x);
+ default: break;
+ }
+
if (0) {
errno = ERANGE; /* The magnitude of ARGUMENT(x) is too large */
/* RETURN_FAILURE(CONSTANT(HUGE_VAL), A range error occurred); */