<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_float.rb, branch v3_2_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-10-18T02:25:12+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2024-10-18T02:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=18074c508105244552678cf6afd4b23304cb4c8f'/>
<id>18074c508105244552678cf6afd4b23304cb4c8f</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>Fix ceil when ndigits is large</title>
<updated>2024-08-02T09:26:26+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-07-26T15:10:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7fc6448ec7f7505ca5772af0a60ee780c321492c'/>
<id>7fc6448ec7f7505ca5772af0a60ee780c321492c</id>
<content type='text'>
[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>
[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>Fix floor when ndigits is large</title>
<updated>2024-08-02T09:26:26+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-07-26T15:10:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7048fbdf59509e4f52eff56d7c044ed28eb67727'/>
<id>7048fbdf59509e4f52eff56d7c044ed28eb67727</id>
<content type='text'>
[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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[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.
</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>
<entry>
<title>Check the encoding of `half:` option</title>
<updated>2020-01-27T07:12:15+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-01-27T07:12:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1ddc719a562b1ee4c3ae6cf4d1f6c386e142b087'/>
<id>1ddc719a562b1ee4c3ae6cf4d1f6c386e142b087</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
