<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_numeric.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 19e539c9ee1701b34189fa0c1feb942adeb0e326: [Backport #21814]</title>
<updated>2026-01-13T01:05:12+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2026-01-13T01:05:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=893dcb5f25cbb0574ae73aa8fc926fd26750a27f'/>
<id>893dcb5f25cbb0574ae73aa8fc926fd26750a27f</id>
<content type='text'>
	[PATCH] [Bug #21814] Fix negative bignum modulo

	If modulo is zero, do not  apply bias even if the divisor is zero.
	`BIGNUM_POSITIVE_P` is true even on bignum zero.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] [Bug #21814] Fix negative bignum modulo

	If modulo is zero, do not  apply bias even if the divisor is zero.
	`BIGNUM_POSITIVE_P` is true even on bignum zero.
</pre>
</div>
</content>
</entry>
<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>Don't change Encoding.default_internal in assert_raise_with_message</title>
<updated>2025-08-15T13:30:09+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2025-08-13T19:08:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=79f52020e2fcc167415e06f16e5d9868571908b3'/>
<id>79f52020e2fcc167415e06f16e5d9868571908b3</id>
<content type='text'>
For most tests (except two), we don't need to change Encoding.default_internal
in assert_raise_with_message. We're trying to run the test suite across
multiple Ractors and modifying Encoding.default_internal can cause other
concurrently running tests to fail.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For most tests (except two), we don't need to change Encoding.default_internal
in assert_raise_with_message. We're trying to run the test suite across
multiple Ractors and modifying Encoding.default_internal can cause other
concurrently running tests to fail.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug#19445] Fix keyword splat in enumerator</title>
<updated>2023-02-17T01:57:22+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-02-17T01:57:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=dd28c55a7cd6780dad637b4d6a20507fbfc6af4a'/>
<id>dd28c55a7cd6780dad637b4d6a20507fbfc6af4a</id>
<content type='text'>
Extracted arguments do not have keyword hash to splat.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extracted arguments do not have keyword hash to splat.</pre>
</div>
</content>
</entry>
<entry>
<title>Remove Numeric#ceildiv</title>
<updated>2022-08-12T06:57:52+00:00</updated>
<author>
<name>Kouhei Yanagita</name>
<email>yanagi@shakenbu.org</email>
</author>
<published>2022-07-21T09:57:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=24e33b84b5adb29d1d2f541acfba65e225b91b55'/>
<id>24e33b84b5adb29d1d2f541acfba65e225b91b55</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Numeric#ceildiv and Integer#ceildiv</title>
<updated>2022-08-12T06:57:52+00:00</updated>
<author>
<name>Kouhei Yanagita</name>
<email>yanagi@shakenbu.org</email>
</author>
<published>2022-05-27T06:46:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4165fd0e763439421296fbc95d754ad53e6ae84f'/>
<id>4165fd0e763439421296fbc95d754ad53e6ae84f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use Rational for Float#round with ndigits &gt; 14</title>
<updated>2021-08-06T22:03:51+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-07-26T18:20:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d16b68cb2204eeb5af8bd39149202b630374c67f'/>
<id>d16b68cb2204eeb5af8bd39149202b630374c67f</id>
<content type='text'>
ndigits higher than 14 can result in values that are slightly too
large due to floating point limitations.  Converting to rational
for the calculation and then back to float fixes these issues.

Fixes [Bug #14635]
Fixes [Bug #17183]

Co-authored by: Yusuke Endoh &lt;mame@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ndigits higher than 14 can result in values that are slightly too
large due to floating point limitations.  Converting to rational
for the calculation and then back to float fixes these issues.

Fixes [Bug #14635]
Fixes [Bug #17183]

Co-authored by: Yusuke Endoh &lt;mame@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Make Float#floor with ndigits argument handle error</title>
<updated>2021-07-27T18:00:45+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-07-26T17:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=35e467080ca35a9a129e95f802f102c3bc0a81b3'/>
<id>35e467080ca35a9a129e95f802f102c3bc0a81b3</id>
<content type='text'>
The previous implementation could result in a returned
float that is 1/(10**ndigits) too low.  First try adding
one before dividing, and if that results in a value that is
greater than the initial number, then try the original
calculation.

Spec added for ciel, but the issue doesn't appear to affect
ciel, at least not for the same number.  If the issue does
effect ciel, a similar fix could probably work for it.

Fixes [Bug #18018]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous implementation could result in a returned
float that is 1/(10**ndigits) too low.  First try adding
one before dividing, and if that results in a value that is
greater than the initial number, then try the original
calculation.

Spec added for ciel, but the issue doesn't appear to affect
ciel, at least not for the same number.  If the issue does
effect ciel, a similar fix could probably work for it.

Fixes [Bug #18018]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix integer/float remainder with infinity argument of opposite sign</title>
<updated>2021-03-12T15:35:18+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-03-10T21:15:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=aaab3b1de943c3317e115d623ffc7908b4c96578'/>
<id>aaab3b1de943c3317e115d623ffc7908b4c96578</id>
<content type='text'>
Previously, the result was incorrect:

4.remainder(-Float::INFINITY)
Before: =&gt; NaN
After: =&gt; 4

4.2.remainder(-Float::INFINITY)
Before: =&gt; NaN
After: =&gt; 4.2

Fixes [Bug #6120]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the result was incorrect:

4.remainder(-Float::INFINITY)
Before: =&gt; NaN
After: =&gt; 4

4.2.remainder(-Float::INFINITY)
Before: =&gt; NaN
After: =&gt; 4.2

Fixes [Bug #6120]
</pre>
</div>
</content>
</entry>
<entry>
<title>numeric.c, range.c: prohibit zero step</title>
<updated>2020-10-23T06:26:51+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@users.noreply.github.com</email>
</author>
<published>2020-10-23T06:26:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f754b422855131111092c0c147d744775cc4793f'/>
<id>f754b422855131111092c0c147d744775cc4793f</id>
<content type='text'>
* numeric.c: prohibit zero step in Numeric#step

* range.c: prohibit zero step in Range#step

* Fix ruby-spec

[Feature #15573]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* numeric.c: prohibit zero step in Numeric#step

* range.c: prohibit zero step in Range#step

* Fix ruby-spec

[Feature #15573]</pre>
</div>
</content>
</entry>
</feed>
