[#64210] Asking for clarification for exception handling usage — Rodrigo Rosenfeld Rosas <rr.rosas@...>
I've created a ticket for that but didn't get any feedback so I decided
[#64517] Fw: Re: Ruby and Rails to become Apache Incubator Project — Tetsuya Kitahata <kitahata@99.alumni.u-tokyo.ac.jp>
What do you think? >> Ruby developers
What benefits are there to this? I have a feeling that adding unnecessary
On Sat, 23 Aug 2014 22:43:46 -0700
Here I am a Japanese. Before moving anywhere else answer to our question first: what benefits?
tax issue with each other.
Forgot to assert my opinions:
[#64614] cowspace (work-in-progress) — Eric Wong <normalperson@...>
Hi all, I started working on a cowspace branch. Based on the mspace API
[#64615] [ruby-trunk - Feature #10181] [Open] New method File.openat() — oss-ruby-lang@...
Issue #10181 has been reported by Technorama Ltd..
I like this feature.
On 08/28/2014 02:53 PM, Eric Wong wrote:
Joel VanderWerf <joelvanderwerf@gmail.com> wrote:
On 08/29/2014 12:55 AM, Eric Wong wrote:
Joel VanderWerf <joelvanderwerf@gmail.com> wrote:
[#64627] [ruby-trunk - Feature #10182] [PATCH] string.c: move frozen_strings table to rb_vm_t — ko1@...
Issue #10182 has been updated by Koichi Sasada.
[#64671] Fwd: [ruby-changes:35240] normal:r47322 (trunk): symbol.c (rb_sym2id): do not return garbage object — SASADA Koichi <ko1@...>
Why this fix solve your problem?
(2014/08/30 8:50), SASADA Koichi wrote:
SASADA Koichi <ko1@atdot.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
(2014/08/31 0:18), Eric Wong wrote:
[ruby-core:64678] [ruby-trunk - Feature #7517] Fixnum::MIN,MAX
Issue #7517 has been updated by cremno phobia.
Even if the use-cases aren't really convincing, I think the informational purpose alone is a good enough argument to add it. If you search for “ruby fixnum max” or something similar, you'll find the interest is there, but the solution(s) usually only work in CRuby and are not as easy to understand as the proposed constants.
~~~ diff
diff --git a/numeric.c b/numeric.c
index 1e971f4..b57c686 100644
--- a/numeric.c
+++ b/numeric.c
@@ -4062,6 +4062,15 @@ Init_Numeric(void)
rb_cFixnum = rb_define_class("Fixnum", rb_cInteger);
+ /*
+ * The minimum value of a Fixnum.
+ */
+ rb_define_const(rb_cFixnum, "MIN", LONG2FIX(FIXNUM_MIN));
+ /*
+ * The maximum value of a Fixnum.
+ */
+ rb_define_const(rb_cFixnum, "MAX", LONG2FIX(FIXNUM_MAX));
+
rb_define_method(rb_cFixnum, "to_s", fix_to_s, -1);
rb_define_alias(rb_cFixnum, "inspect", "to_s");
diff --git a/test/ruby/test_fixnum.rb b/test/ruby/test_fixnum.rb
index 8b2cf2e..8c896ec 100644
--- a/test/ruby/test_fixnum.rb
+++ b/test/ruby/test_fixnum.rb
@@ -312,4 +312,20 @@ class TestFixnum < Test::Unit::TestCase
assert_equal(1, 5.remainder(4))
assert_predicate(4.remainder(Float::NAN), :nan?)
end
+
+ def test_min
+ assert_kind_of(Fixnum, Fixnum::MIN)
+ assert_kind_of(Bignum, Fixnum::MIN - 1)
+ if RUBY_ENGINE == 'ruby'
+ assert_equal(-2 ** (1.size * 8 - 2), Fixnum::MIN)
+ end
+ end
+
+ def test_max
+ assert_kind_of(Fixnum, Fixnum::MAX)
+ assert_kind_of(Bignum, Fixnum::MAX + 1)
+ if RUBY_ENGINE == 'ruby'
+ assert_equal(2 ** (1.size * 8 - 2) - 1, Fixnum::MAX)
+ end
+ end
end
~~~
----------------------------------------
Feature #7517: Fixnum::MIN,MAX
https://bugs.ruby-lang.org/issues/7517#change-48573
* Author: Yukihiro Matsumoto
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* Category: core
* Target version: next minor
----------------------------------------
Maximum (or minimum) number of fixnum can not be get in portable fashion, so I propose Fixnum::MAX and Fixnum::MIN just like Float::MAX and Float::MIN.
Matz
--
https://bugs.ruby-lang.org/