From: "rubydev (Adam Carpenter)" Date: 2012-07-24T20:53:14+09:00 Subject: [ruby-core:46720] [ruby-trunk - Feature #2347] Math::INFINITY Issue #2347 has been updated by rubydev (Adam Carpenter). naruse (Yui NARUSE) wrote: > =begin > This issue was solved with changeset r26197. > Marc-Andre, thank you for reporting this issue. > Your contribution to Ruby is greatly appreciated. > May Ruby be with you. > > =end thank you Marc for figuring out this bug - helpful code ~Adam http://ville-web.ch ---------------------------------------- Feature #2347: Math::INFINITY https://bugs.ruby-lang.org/issues/2347#change-28387 Author: marcandre (Marc-Andre Lafortune) Status: Closed Priority: Low Assignee: matz (Yukihiro Matsumoto) Category: core Target version: 1.9.2 =begin It is easy to get an infinity in Ruby (ex: 1.0/0) but that may not be obvious to everyone. Could we have Math::INFINITY which would make code using it cleaner? Thanks diff --git a/math.c b/math.c index 51caf35..653a239 100644 --- a/math.c +++ b/math.c @@ -764,6 +764,7 @@ Init_Math(void) #else rb_define_const(rb_mMath, "E", DBL2NUM(exp(1.0))); #endif + rb_define_const(rb_mMath, "INFINITY", DBL2NUM(1.0/0.0)); rb_define_module_function(rb_mMath, "atan2", math_atan2, 2); rb_define_module_function(rb_mMath, "cos", math_cos, 1); =end -- http://bugs.ruby-lang.org/