Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

FloatDomainError: NaN #1

tarcieri opened this Issue Mar 24, 2012 · 1 comment


None yet
2 participants

tarcieri commented Mar 24, 2012

I'm getting this consistently across multiple Ruby implementations benchmarking Celluloid's UUID implementation. I hope that means it's roflscale.


clone git://github.com/celluloid/celluloid.git
ruby benchmarks/uuid.rb

I get:

Calculating -------------------------------------
                uuid     22819 i/100ms
                uuidI, [2012-03-24T16:45:12.456314 #66670]  INFO -- : Shutdown completed cleanly
/Users/tony/.rvm/gems/ruby-1.9.3-p125/gems/benchmark-ips-1.1.0/lib/benchmark/ips.rb:239:in `round': NaN (FloatDomainError)
    from /Users/tony/.rvm/gems/ruby-1.9.3-p125/gems/benchmark-ips-1.1.0/lib/benchmark/ips.rb:239:in `block in ips'
    from /Users/tony/.rvm/gems/ruby-1.9.3-p125/gems/benchmark-ips-1.1.0/lib/benchmark/ips.rb:201:in `each'
    from /Users/tony/.rvm/gems/ruby-1.9.3-p125/gems/benchmark-ips-1.1.0/lib/benchmark/ips.rb:201:in `ips'
    from benchmarks/uuid.rb:8:in `<main>'

Or on rbx:

An exception occurred running benchmarks/uuid.rb
    Numerical argument out of domain - sqrt (Errno::EDOM)

Or on JRuby:

Math::DomainError: Numerical argument is out of domain - "sqrt"
    sqrt at org/jruby/RubyMath.java:494

@evanphx evanphx closed this in be40b0e Mar 27, 2012


tarcieri commented Apr 5, 2012

Just found the root cause of this, if you're curious:


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