summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-10 08:45:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-10 08:45:26 +0000
commit19c42c0740145dec1be93c332647f4310ea19918 (patch)
tree88516eac5daf33e2e935c3d38415e13d542ac131 /math.c
parentff0abdc55e57f42f75204429c9eca471df48d835 (diff)
* variable.c (rb_obj_remove_instance_variable): raise NameError if
specified instance variable is not defined. * variable.c (generic_ivar_remove): modified to check ivar existence. * file.c (rb_file_s_extname): new method based on the proposal (and patch) from Mike Hall. [new] * eval.c (error_handle): default to 1 unless status is set. * eval.c (ruby_options): guard error_handle() with PROT_NONE. * eval.c (ruby_stop): ditto. * math.c (math_acosh): added. [new] * math.c (math_asinh): ditto. * math.c (math_atanh): ditto. * struct.c (rb_struct_each_pair): method added. [new] * class.c (rb_singleton_class): wrong condition; was creating unnecessary singleton class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r--math.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/math.c b/math.c
index 4af3cef..c900a0b 100644
--- a/math.c
+++ b/math.c
@@ -113,6 +113,30 @@ math_tanh(obj, x)
}
static VALUE
+math_acosh(obj, x)
+ VALUE obj, x;
+{
+ Need_Float(x);
+ return rb_float_new(acosh(RFLOAT(x)->value));
+}
+
+static VALUE
+math_asinh(obj, x)
+ VALUE obj, x;
+{
+ Need_Float(x);
+ return rb_float_new(asinh(RFLOAT(x)->value));
+}
+
+static VALUE
+math_atanh(obj, x)
+ VALUE obj, x;
+{
+ Need_Float(x);
+ return rb_float_new(atanh(RFLOAT(x)->value));
+}
+
+static VALUE
math_exp(obj, x)
VALUE obj, x;
{
@@ -212,6 +236,10 @@ Init_Math()
rb_define_module_function(rb_mMath, "sinh", math_sinh, 1);
rb_define_module_function(rb_mMath, "tanh", math_tanh, 1);
+ rb_define_module_function(rb_mMath, "acosh", math_acosh, 1);
+ rb_define_module_function(rb_mMath, "asinh", math_asinh, 1);
+ rb_define_module_function(rb_mMath, "atanh", math_atanh, 1);
+
rb_define_module_function(rb_mMath, "exp", math_exp, 1);
rb_define_module_function(rb_mMath, "log", math_log, 1);
rb_define_module_function(rb_mMath, "log10", math_log10, 1);