<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_float.rb, branch v3_3_11</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) c1862cbb89a6bf42dcd07d92fe4f4bfeebca5775: [Backport #20719]</title>
<updated>2024-11-04T22:37:14+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-11-04T22:37:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=34a0f41d0aaff190f1647a6fa0e905690d0eff98'/>
<id>34a0f41d0aaff190f1647a6fa0e905690d0eff98</id>
<content type='text'>
	[Bug #20719] `Float` argument must be ASCII compatible
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20719] `Float` argument must be ASCII compatible
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20654] Fix floor and ceil when ndigits is large (#11277)</title>
<updated>2024-07-30T16:05:09+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-07-30T16:05:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0922afa95b3e390876cbea7f78d3d93d979f27d4'/>
<id>0922afa95b3e390876cbea7f78d3d93d979f27d4</id>
<content type='text'>
* Fix floor when ndigits is large

[Bug #20654]

This commit fixes Integer#floor and Float#floor when the number is
negative and ndigits is large such that 10**ndigits is a bignum.

Previously, it would return 0 in such cases. However, this would cause
unexpected behaviour such as:

    puts -1.floor(-5) # =&gt; -100000
    puts -1.floor(-10) # =&gt; -10000000000
    puts -1.floor(-20) # =&gt; 0

This commit changes the last result so that it will return
-100000000000000000000.

* Fix ceil when ndigits is large

[Bug #20654]

This commit fixes Integer#ceil and Float#ceil when the number is
negative and ndigits is large such that 10**ndigits is a bignum.

Previously, it would return 0 in such cases. However, this would cause
unexpected behaviour such as:

    puts 1.ceil(-5) # =&gt; 100000
    puts 1.ceil(-10) # =&gt; 10000000000
    puts 1.ceil(-20) # =&gt; 0

This commit changes the last result so that it will return
100000000000000000000.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix floor when ndigits is large

[Bug #20654]

This commit fixes Integer#floor and Float#floor when the number is
negative and ndigits is large such that 10**ndigits is a bignum.

Previously, it would return 0 in such cases. However, this would cause
unexpected behaviour such as:

    puts -1.floor(-5) # =&gt; -100000
    puts -1.floor(-10) # =&gt; -10000000000
    puts -1.floor(-20) # =&gt; 0

This commit changes the last result so that it will return
-100000000000000000000.

* Fix ceil when ndigits is large

[Bug #20654]

This commit fixes Integer#ceil and Float#ceil when the number is
negative and ndigits is large such that 10**ndigits is a bignum.

Previously, it would return 0 in such cases. However, this would cause
unexpected behaviour such as:

    puts 1.ceil(-5) # =&gt; 100000
    puts 1.ceil(-10) # =&gt; 10000000000
    puts 1.ceil(-20) # =&gt; 0

This commit changes the last result so that it will return
100000000000000000000.</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #19335] `Integer#remainder` should respect `#coerce` (#7120)</title>
<updated>2023-01-15T04:03:27+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-01-15T04:03:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=71ce7e1825c5b8fe08dd96cd77c6a379afd34256'/>
<id>71ce7e1825c5b8fe08dd96cd77c6a379afd34256</id>
<content type='text'>
Also `Numeric#remainder` should.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also `Numeric#remainder` should.</pre>
</div>
</content>
</entry>
<entry>
<title>numeric.c: Fix round_half_even for specific values (#7023)</title>
<updated>2022-12-26T12:02:47+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>3959+mrkn@users.noreply.github.com</email>
</author>
<published>2022-12-26T12:02:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9f2378959e5c5b5c39c9993f1a84e5304ff113d6'/>
<id>9f2378959e5c5b5c39c9993f1a84e5304ff113d6</id>
<content type='text'>
Handle the integert and the float parts separately in round_half_even
to prevent error occursions in floating point calculation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Handle the integert and the float parts separately in round_half_even
to prevent error occursions in floating point calculation.</pre>
</div>
</content>
</entry>
<entry>
<title>Add invalid hexadecimal float tests</title>
<updated>2022-08-21T11:01:27+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-06-30T21:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0cc989696e9a7d0386773d23aa64de8fc04ea9fe'/>
<id>0cc989696e9a7d0386773d23aa64de8fc04ea9fe</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix dtoa buffer overrun</title>
<updated>2022-04-12T12:30:49+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-06-30T21:39:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0a822eec524522d81ffc7da2bb1baf906b0318a'/>
<id>d0a822eec524522d81ffc7da2bb1baf906b0318a</id>
<content type='text'>
https://hackerone.com/reports/1248108
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://hackerone.com/reports/1248108
</pre>
</div>
</content>
</entry>
<entry>
<title>Attempt to fix floating point test failure</title>
<updated>2021-05-29T21:08:24+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-05-29T21:08:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fd65ef2a5aa8629676d1edb6410e4d4cf60b8045'/>
<id>fd65ef2a5aa8629676d1edb6410e4d4cf60b8045</id>
<content type='text'>
The previous behavior depending on exact float values, it seemed
to work OK on amd64 and i386, but other CI platforms are
experiencing non-deterministic test failures with it. Relax test
slightly to hopefully pass on such platforms.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous behavior depending on exact float values, it seemed
to work OK on amd64 and i386, but other CI platforms are
experiencing non-deterministic test failures with it. Relax test
slightly to hopefully pass on such platforms.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Enumerator::ArithmeticSequence handling of float ranges</title>
<updated>2021-05-29T15:56:15+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-04-29T19:51:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f516379853f36d143d820c55d5eeaa9fc410ef52'/>
<id>f516379853f36d143d820c55d5eeaa9fc410ef52</id>
<content type='text'>
Depending on the float range, there could be an off-by-one error,
where the last result that should be in the range was missed. Fix
this by checking if the computed value for the expected value
outside the range is still inside the range, and if so, increment
the step size.

Fixes [Bug #16612]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Depending on the float range, there could be an off-by-one error,
where the last result that should be in the range was missed. Fix
this by checking if the computed value for the expected value
outside the range is still inside the range, and if so, increment
the step size.

Fixes [Bug #16612]
</pre>
</div>
</content>
</entry>
<entry>
<title>numeric.c: optimize `float ** 2` case by fastpath</title>
<updated>2020-05-11T17:14:27+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2020-05-11T17:12:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=42abad2464a78e3ec8a42f85c7bc878233f3ce16'/>
<id>42abad2464a78e3ec8a42f85c7bc878233f3ce16</id>
<content type='text'>
It would be a relatively frequent case.  It is still slower than
`float * float` because `*` has a dedicated VM instruction (opt_mult),
though.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It would be a relatively frequent case.  It is still slower than
`float * float` because `*` has a dedicated VM instruction (opt_mult),
though.
</pre>
</div>
</content>
</entry>
<entry>
<title>Show unmatched sequence on failure</title>
<updated>2020-02-07T09:10:36+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-02-07T09:10:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b64b0f3433b1dafa50ecd12b86567e3df863d57a'/>
<id>b64b0f3433b1dafa50ecd12b86567e3df863d57a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
