Skip to content

Fix Float::INFINITY BigDecimal comparison#4618

Merged
headius merged 1 commit intojruby:masterfrom
cammellos:master
Jun 5, 2017
Merged

Fix Float::INFINITY BigDecimal comparison#4618
headius merged 1 commit intojruby:masterfrom
cammellos:master

Conversation

@cammellos
Copy link
Contributor

Hi,

this fixes #4572

Any feedback would be appreciated

Thanks for the project!

andrea

@cammellos
Copy link
Contributor Author

The build seems ok on my branch, https://travis-ci.org/cammellos/jruby . The test failing seems to be unrelated to the commit, shoud I take a look at it or is ok?

@kares
Copy link
Member

kares commented Jun 5, 2017

@headius this seems to pass fine and isn't a big change, what do you think including the patch for 9.1 ?

@kares
Copy link
Member

kares commented Jun 5, 2017

double checked that this wasn't the behaviour in MRI 2.3.1 but the specs seems to match MRI (>=) 2.3.3

@headius
Copy link
Member

headius commented Jun 5, 2017

@kares Seems appropriate to include it in 9.1.11.

@headius headius merged commit fce4eaa into jruby:master Jun 5, 2017
@headius
Copy link
Member

headius commented Jun 5, 2017

Thanks for the fix and specs!

@kares kares added this to the JRuby 9.1.11.0 milestone Jun 5, 2017
@eregon
Copy link
Member

eregon commented Jun 23, 2017

These specs do not pass on MRI 2.3.3 and 2.3.4:

for ruby in 2.3.3 2.3.4 2.4.0; do chruby $ruby; ruby -v -rbigdecimal -e 'p BigDecimal("-0.2E5556") > -Float::INFINITY'; done
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
false
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux]
false
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
true

It looks like a MRI bug in 2.3.x.

@eregon
Copy link
Member

eregon commented Jun 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't compare BigDecimal with Float::INFINITY got FloatDomainError: NaN

4 participants