You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JRuby version: jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.91-b14 on 1.8.0_91-b14 +jit [darwin-x86_64]
Output uname: ruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.91-b14 on 1.8.0_91-b14 +jit [darwin-x86_64]
I'm using JRuby on Rails. I can't compare BigDecimal with Float::INFINITY.
I can do this in MRI, but not in JRuby.
Ruby MRI version: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
# MRI
BigDecimal.new(100) <= Float::INFINITY
=> true
# JRuby
BigDecimal.new(100) <= Float::INFINITY
=> FloatDomainError: NaN
from org/jruby/ext/bigdecimal/RubyBigDecimal.java:513:in `new'
from org/jruby/ext/bigdecimal/RubyBigDecimal.java:638:in `new'
from org/jruby/ext/bigdecimal/RubyBigDecimal.java:1163:in `<='
from (irb):1:in `<eval>'
from org/jruby/RubyKernel.java:1000:in `eval'
from org/jruby/RubyKernel.java:1298:in `loop'
from org/jruby/RubyKernel.java:1120:in `catch'
from org/jruby/RubyKernel.java:1120:in `catch'
from /Users/opanmustopah/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/railties-4.2.7.1/lib/rails/commands/console.rb:110:in `start'
from /Users/opanmustopah/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/railties-4.2.7.1/lib/rails/commands/console.rb:9:in `start'
from /Users/opanmustopah/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/opanmustopah/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/opanmustopah/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<main>'
from org/jruby/RubyKernel.java:961:in `require'
from bin/rails:11:in `<main>'
I think this should work too on JRuby.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
opan
changed the title
Can't compare BigDecimal with Float::INFINITY got FloatDomainError: NaN
Can't compare BigDecimal with Float::INFINITY got FloatDomainError: NaN
Apr 25, 2017
jruby-9.1.8.0 :003 > BigDecimal.new(100) <= Float::INFINITY
FloatDomainError: NaN
from org/jruby/ext/bigdecimal/RubyBigDecimal.java:511:in `new'
from org/jruby/ext/bigdecimal/RubyBigDecimal.java:636:in `new'
from org/jruby/ext/bigdecimal/RubyBigDecimal.java:1161:in `<='
from (irb):3:in `<eval>'
JRuby version:
jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.91-b14 on 1.8.0_91-b14 +jit [darwin-x86_64]
Output
uname
:ruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.91-b14 on 1.8.0_91-b14 +jit [darwin-x86_64]
I'm using JRuby on Rails. I can't compare
BigDecimal
withFloat::INFINITY
.I can do this in MRI, but not in JRuby.
Ruby MRI version:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
I think this should work too on JRuby.
Thanks in advance.
The text was updated successfully, but these errors were encountered: