diff options
Diffstat (limited to 'src/math/cosh.c')
| -rw-r--r-- | src/math/cosh.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/math/cosh.c b/src/math/cosh.c new file mode 100644 index 00000000..75301cf1 --- /dev/null +++ b/src/math/cosh.c @@ -0,0 +1,29 @@ +# define TGSOURCE "cosh.c" +#include <math.h> +#include "nonstd/tgmath.h" +#include "errno.h" + +/** hyperbolic cosine **/ +TYPE TGFN(cosh)(TYPE x) +{ + if (0) { + errno = ERANGE; /* The magnitude of ARGUMENT(x) is too large */ + /* RETURN_FAILURE(CONSTANT(HUGE_VAL), A range error occurred); */ + return TGHUGE; + } + + /* RETURN_SUCCESS(the hyperbolic cosine of ARGUMENT(x)); */ + return x; +} + +/*** +compute the hyperbolic cosine of ARGUMENT(x). +***/ + +/* +IMPLEMENTATION(The value returned on a domain error, CONSTANT(HUGE_VAL)) +LINK(m) +*/ +/* +STDC(1) +*/ |
