Skip to content

Math.atan 0.0/0.0 #313

@ashbb

Description

@ashbb

I got the following outputs. The correct output of Math.atan 0.0/0.0 is NaN. Right?

C:\tmp>jruby -v
jruby 1.7.0.RC1 (1.9.3p203) 2012-09-25 8e849de on Java HotSpot(TM) Client VM 1.7
.0_03-b05 [Windows 7-x86]

C:\tmp>jruby -S irb
irb(main):001:0> 0.0/0.0
=> NaN
irb(main):002:0> Math.atan 0.0/0.0
Math::DomainError: Numerical argument is out of domain - "atan"
        from org/jruby/RubyMath.java:196:in `atan'
        from (irb):2:in `evaluate'
        from org/jruby/RubyKernel.java:1065:in `eval'
        from org/jruby/RubyKernel.java:1390:in `loop'
        from org/jruby/RubyKernel.java:1173:in `catch'
        from org/jruby/RubyKernel.java:1173:in `catch'
        from c:/jruby/bin/jirb:13:in `(root)'
C:\tmp>jruby --1.9 -v
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) Client VM 1
.7.0_03) [Windows 7-x86-java]

C:\tmp>jruby --1.9 -S irb
irb(main):001:0> 0.0/0.0
=> NaN
irb(main):002:0> Math.atan 0.0/0.0
=> NaN

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions