<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_rational.rb, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Fix tests using assert_raise_with_message on US-ASCII systems</title>
<updated>2025-08-16T02:42:07+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2025-08-16T01:15:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=87c4ebd00115b9424f04813b4dd5f3d087a14eb9'/>
<id>87c4ebd00115b9424f04813b4dd5f3d087a14eb9</id>
<content type='text'>
On systems where the Encoding.default_internal defaults to US-ASCII instead
of UTF-8, some tests using assert_raise_with_message can fail since it no
longer changes Encoding.default_internal in 79f5202.

This tests explicitly uses EnvUtil.with_default_internal on systems where
these tests fail.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On systems where the Encoding.default_internal defaults to US-ASCII instead
of UTF-8, some tests using assert_raise_with_message can fail since it no
longer changes Encoding.default_internal in 79f5202.

This tests explicitly uses EnvUtil.with_default_internal on systems where
these tests fail.
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not round `a**b` to infinity</title>
<updated>2024-11-08T10:48:56+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-11-08T05:46:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=45cd4a8296814f3b082dfb906cdef29974726731'/>
<id>45cd4a8296814f3b082dfb906cdef29974726731</id>
<content type='text'>
... instead, just calculate the value unless it is too big.
Also, this change raises an ArgumentError if it is expected to exceed
16 GB in a 64-bit environment.

(It is possible to calculate it straightforward, but it would likely be
out-of-memory, so I didn't think it would make sense.)

[Feature #20811]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... instead, just calculate the value unless it is too big.
Also, this change raises an ArgumentError if it is expected to exceed
16 GB in a 64-bit environment.

(It is possible to calculate it straightforward, but it would likely be
out-of-memory, so I didn't think it would make sense.)

[Feature #20811]
</pre>
</div>
</content>
</entry>
<entry>
<title>A negative denominator case in the Rational string parsing test</title>
<updated>2022-12-10T09:57:20+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-10T09:57:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fd440b09fc64b1d2275942c7f6d1e1f4069e85ae'/>
<id>fd440b09fc64b1d2275942c7f6d1e1f4069e85ae</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test_cdhash: refactor change class</title>
<updated>2021-05-12T01:30:46+00:00</updated>
<author>
<name>卜部昌平</name>
<email>shyouhei@ruby-lang.org</email>
</author>
<published>2021-05-10T01:02:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6911b4bc82889860ff7da4ecf975504cdc3e5314'/>
<id>6911b4bc82889860ff7da4ecf975504cdc3e5314</id>
<content type='text'>
It is now strange to test Complex in a class named Rational_Test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is now strange to test Complex in a class named Rational_Test.
</pre>
</div>
</content>
</entry>
<entry>
<title>cdhash_cmp: can also take complex</title>
<updated>2021-05-12T01:30:46+00:00</updated>
<author>
<name>卜部昌平</name>
<email>shyouhei@ruby-lang.org</email>
</author>
<published>2021-05-07T03:49:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cc0dc67bbbe1951ff90004bc987f78545625d772'/>
<id>cc0dc67bbbe1951ff90004bc987f78545625d772</id>
<content type='text'>
There are complex literals `123i`, which can also be a case condition.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are complex literals `123i`, which can also be a case condition.
</pre>
</div>
</content>
</entry>
<entry>
<title>cdhash_cmp: rational literals with fractions</title>
<updated>2021-05-12T01:30:46+00:00</updated>
<author>
<name>卜部昌平</name>
<email>shyouhei@ruby-lang.org</email>
</author>
<published>2021-05-07T02:07:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0e6c6e682b9ba2b0309a5177933a0628e8ef316'/>
<id>d0e6c6e682b9ba2b0309a5177933a0628e8ef316</id>
<content type='text'>
Nobu kindly pointed out that rational literals can have fractions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Nobu kindly pointed out that rational literals can have fractions.
</pre>
</div>
</content>
</entry>
<entry>
<title>cdhash_cmp: can take rational literals</title>
<updated>2021-05-12T01:30:46+00:00</updated>
<author>
<name>卜部昌平</name>
<email>shyouhei@ruby-lang.org</email>
</author>
<published>2021-05-07T01:04:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2bc293e899c9d32dcd794a73de8925c49ecf8f15'/>
<id>2bc293e899c9d32dcd794a73de8925c49ecf8f15</id>
<content type='text'>
Rational literals are those integers suffixed with `r`.  They tend to
be a part of more complex expressions like `123/456r`, but in theory
they can live alone.  When such "bare" rational literals are passed to
case-when branch, we have to take care of them.  Fixes [Bug #17854]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rational literals are those integers suffixed with `r`.  They tend to
be a part of more complex expressions like `123/456r`, but in theory
they can live alone.  When such "bare" rational literals are passed to
case-when branch, we have to take care of them.  Fixes [Bug #17854]
</pre>
</div>
</content>
</entry>
<entry>
<title>Make reciprocal properly of non-integral rational [Bug #17572]</title>
<updated>2021-01-23T01:30:59+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-01-23T01:28:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a55eb9a2af7950d180d9d31ffde2bce66710f44f'/>
<id>a55eb9a2af7950d180d9d31ffde2bce66710f44f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test/ruby/test_rational.rb: Prevent "assigned but unused variable"</title>
<updated>2020-10-27T15:27:56+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2020-10-27T15:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c1bebbb2eee5e8d808d55a9cb27f492e58331540'/>
<id>c1bebbb2eee5e8d808d55a9cb27f492e58331540</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>rational.c: convert a numerator to rational before calling fdiv in Kernel.Rational() (#3702)</title>
<updated>2020-10-26T09:43:30+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@users.noreply.github.com</email>
</author>
<published>2020-10-26T09:43:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=69837229d74813c807e9d079aaee33aec2c7a4d0'/>
<id>69837229d74813c807e9d079aaee33aec2c7a4d0</id>
<content type='text'>
This makes `Rational(BigDecimal(1), 60) == Rational(1, 60)`.
[Bug #16518]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes `Rational(BigDecimal(1), 60) == Rational(1, 60)`.
[Bug #16518]</pre>
</div>
</content>
</entry>
</feed>
