summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-11 10:03:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-11 10:03:01 +0000
commit5527b3b961a76f2de03a5e42b80a99d8f9b44bdf (patch)
tree5ff49695caf66116c44adbd1a331e53eeab4dd43 /math.c
parent3a202ff2b4b39e910c7b99e2993ac5e5e12f2ad1 (diff)
* eval.c (assign): ruby_verbose should be surrounded by RTEST().
* object.c (rb_str2cstr): ditto. * parse.y (void_expr): ditto. * parse.y (void_stmts): ditto. * variable.c (rb_ivar_get): ditto. * variable.c (rb_cvar_set): ditto. * variable.c (rb_cvar_get): ditto. * dir.c (glob_helper): should have proceed link when link->path was non existing symbolic link. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r--math.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/math.c b/math.c
index c900a0b..ba5a121 100644
--- a/math.c
+++ b/math.c
@@ -88,6 +88,15 @@ math_atan(obj, x)
return rb_float_new(atan(RFLOAT(x)->value));
}
+#ifndef HAVE_COSH
+double
+cosh(x)
+ double x;
+{
+ return (exp(x) + exp(-x)) / 2;
+}
+#endif
+
static VALUE
math_cosh(obj, x)
VALUE obj, x;
@@ -96,6 +105,15 @@ math_cosh(obj, x)
return rb_float_new(cosh(RFLOAT(x)->value));
}
+#ifndef HAVE_SINH
+double
+sinh(x)
+ double x;
+{
+ return (exp(x) - exp(-x)) / 2;
+}
+#endif
+
static VALUE
math_sinh(obj, x)
VALUE obj, x;
@@ -104,6 +122,15 @@ math_sinh(obj, x)
return rb_float_new(sinh(RFLOAT(x)->value));
}
+#ifndef HAVE_SINH
+double
+tanh(x)
+ double x;
+{
+ return sinh(x) / cosh(x);
+}
+#endif
+
static VALUE
math_tanh(obj, x)
VALUE obj, x;