[#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:64568] [ruby-trunk - Bug #2121] [Closed] mathn/rational destroys Fixnum#/, Fixnum#quo and Bignum#/, Bignum#quo
Issue #2121 has been updated by Hiroshi SHIBATA.
Status changed from Assigned to Closed
mathn library is deprecated on trunk [Feature #10169]
----------------------------------------
Bug #2121: mathn/rational destroys Fixnum#/, Fixnum#quo and Bignum#/, Bignu=
m#quo
https://bugs.ruby-lang.org/issues/2121#change-48497
* Author: Charles Nutter
* Status: Closed
* Priority: Normal
* Assignee: Keiju Ishitsuka
* Category: lib
* Target version:=20
* ruby -v: Any 1.8.6 or higher
* Backport:=20
----------------------------------------
=3Dbegin
I've known this for a while, but only now realized this is actually a terr=
ible bug.
=20
The mathn library replaces Fixnum#/ and Bignum#/ causing them to return a =
different value. When the result of a division is not an integral value, th=
e default versions will return 0. I can think of many algorithms that would=
use this expectation, and most other languages will not upconvert integral=
numeric types to floating-point or fractional types without explicit conse=
nt by the programmer.
=20
When requiring 'mathn', Fixnum#/ and Bignum#/ are replaced with versions t=
hat return a fractional value ('quo') causing a core math operator to retur=
n not just a different type, but *a different value*.
=20
No core library should be allowed to modify the return value of core numer=
ic operators, or else those operators are worthless; you can't rely on them=
to return a specific value *ever* since someone else could require 'mathn'=
or 'rational'.
=20
Note also that 'rational' destroys Fixnum#quo and Bignum#quo. This is also=
a bug that should be fixed, though it is less dangerous because they're no=
t commonly-used operators.
=20
The following code should not fail; Fixnum#/ should never return a value o=
f a different magnitude based on which libraries are loaded:
=20
{{{
require 'test/unit'
=20
class TestFixnumMath < Test::Unit::TestCase
# 0 to ensure it runs first, for illustration purposes
def test_0_without_mathn
assert_equal 0, 1/3
end
=20
def test_with_mathn
require 'mathn'
assert_equal 0, 1/3
end
end
}}}
=20
But it does fail:
=20
{{{
~/projects/jruby =E2=9E=94 ruby test_fixnum_math.rb=20
Loaded suite test_fixnum_math
Started
.F
Finished in 0.016003 seconds.
=20
1) Failure:
test_with_mathn(TestFixnumMath) [test_fixnum_math.rb:11]:
<0> expected but was
<1/3>.
=20
2 tests, 2 assertions, 1 failures, 0 errors
}}}
=3Dend
--=20
https://bugs.ruby-lang.org/