mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* math.c (math_erf,math_erfc): new function. [ruby-list:37753]
* eval.c (ruby_finalize): no longer need to turn off $DEBUG in the finalizer. (ruby-bugs-ja PR#473) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bd368e9749
commit
c004ecfa1e
7 changed files with 36 additions and 2 deletions
19
math.c
19
math.c
|
@ -271,6 +271,22 @@ math_hypot(obj, x, y)
|
|||
return rb_float_new(hypot(RFLOAT(x)->value, RFLOAT(y)->value));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
math_erf(obj, x)
|
||||
VALUE obj, x;
|
||||
{
|
||||
Need_Float(x);
|
||||
return rb_float_new(erf(RFLOAT(x)->value));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
math_erfc(obj, x)
|
||||
VALUE obj, x;
|
||||
{
|
||||
Need_Float(x);
|
||||
return rb_float_new(erfc(RFLOAT(x)->value));
|
||||
}
|
||||
|
||||
void
|
||||
Init_Math()
|
||||
{
|
||||
|
@ -314,4 +330,7 @@ Init_Math()
|
|||
rb_define_module_function(rb_mMath, "ldexp", math_ldexp, 2);
|
||||
|
||||
rb_define_module_function(rb_mMath, "hypot", math_hypot, 2);
|
||||
|
||||
rb_define_module_function(rb_mMath, "erf", math_erf, 1);
|
||||
rb_define_module_function(rb_mMath, "erfc", math_erfc, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue