Skip to content

Commit

Permalink
* math.c (math_erf,math_erfc): new function. [ruby-list:37753]
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
matz committed Jun 5, 2003
1 parent bd368e9 commit c004ecf
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Thu Jun 5 15:09:06 2003 Yukihiro Matsumoto <[email protected]>

* math.c (math_erf,math_erfc): new function. [ruby-list:37753]

Thu Jun 5 05:49:43 2003 why the lucky stiff <[email protected]>

* ext/syck/rubyext.c: using GC nodes caused segfault. [ruby-core:1071]
Expand All @@ -11,6 +15,11 @@ Thu Jun 5 04:48:57 2003 why the lucky stiff <[email protected]>
* ext/syck/handler.c, ext/syck/syck.c: ensure a fresh strtable between
parser iterations.

Wed Jun 4 12:06:59 2003 Yukihiro Matsumoto <[email protected]>

* eval.c (ruby_finalize): no longer need to turn off $DEBUG in the
finalizer. (ruby-bugs-ja PR#473)

Tue Jun 3 22:20:49 2003 Yukihiro Matsumoto <[email protected]>

* eval.c (rb_call_super): should search superclass method based on
Expand Down
1 change: 1 addition & 0 deletions LEGAL
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ st.[ch]:
x68/*:
missing/alloca.c:
missing/dup2.c:
missing/erf.c:
missing/finite.c:
missing/hypot.c:
missing/isinf.c:
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ missing/acosh.c
missing/alloca.c
missing/crypt.c
missing/dup2.c
missing/erf.c
missing/file.h
missing/fileblocks.c
missing/finite.c
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ AC_FUNC_FSEEKO
AC_CHECK_FUNCS(ftello)
AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
strchr strstr strtoul crypt flock vsnprintf\
isinf isnan finite hypot acosh)
isinf isnan finite hypot acosh erf)
AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync\
truncate chsize times utimes fcntl lockf lstat symlink readlink\
setitimer setruid seteuid setreuid setresuid setproctitle\
Expand Down
1 change: 0 additions & 1 deletion eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,6 @@ ruby_finalize()
{
int state;

ruby_debug = Qfalse;
PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
rb_trap_exit();
Expand Down
19 changes: 19 additions & 0 deletions math.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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);
}
5 changes: 5 additions & 0 deletions missing.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ extern double frexp _((double, int *));
extern double hypot _((double, double));
#endif

#ifndef HAVE_ERF
extern double erf _((double, double));
extern double erfc _((double, double));
#endif

#ifndef HAVE_ISINF
extern int isinf _((double));
#endif
Expand Down

0 comments on commit c004ecf

Please sign in to comment.