diff options
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -100,7 +100,6 @@ Fmath_sqrt(obj, x) struct RFloat *x; { Need_Float(x); - return float_new(log10(x->value)); if (x->value < 0.0) Fail("square root for negative number"); return float_new(sqrt(x->value)); @@ -110,15 +109,13 @@ Init_Math() { M_Math = rb_define_module("Math"); - rb_define_method(M_Math, "atan2", Fmath_atan2, 2); - rb_define_method(M_Math, "cos", Fmath_cos, 1); - rb_define_method(M_Math, "sin", Fmath_sin, 1); - rb_define_method(M_Math, "tan", Fmath_tan, 1); - - rb_define_method(M_Math, "exp", Fmath_exp, 1); - rb_define_method(M_Math, "log", Fmath_log, 1); - rb_define_method(M_Math, "log10", Fmath_log10, 1); - rb_define_method(M_Math, "sqrt", Fmath_sqrt, 1); + rb_define_module_function(M_Math, "atan2", Fmath_atan2, 2); + rb_define_module_function(M_Math, "cos", Fmath_cos, 1); + rb_define_module_function(M_Math, "sin", Fmath_sin, 1); + rb_define_module_function(M_Math, "tan", Fmath_tan, 1); - rb_include_module(CLASS_OF(M_Math), M_Math); + rb_define_module_function(M_Math, "exp", Fmath_exp, 1); + rb_define_module_function(M_Math, "log", Fmath_log, 1); + rb_define_module_function(M_Math, "log10", Fmath_log10, 1); + rb_define_module_function(M_Math, "sqrt", Fmath_sqrt, 1); } |