diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-11 10:03:01 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-11 10:03:01 +0000 |
commit | 0394e8e30c4f7fbf106038464109e92eb9a3c413 (patch) | |
tree | 5ff49695caf66116c44adbd1a331e53eeab4dd43 /math.c | |
parent | b0f41f8d3499722cef5c5aa523932c99ae7b590d (diff) | |
download | ruby-0394e8e30c4f7fbf106038464109e92eb9a3c413.tar.gz ruby-0394e8e30c4f7fbf106038464109e92eb9a3c413.tar.xz ruby-0394e8e30c4f7fbf106038464109e92eb9a3c413.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@2363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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; |