Prime.include?(1) hangs Ruby scripts and irb

F

Frisco Del Rosario

Ruby version 1.8.6
Mac OS 10.5.2

I would like a Ruby script to do something if a result is a prime
number, or do something else if the result is not prime. But Ruby is
hanging on instance_of_Prime.includes?(some prime number). For example,
in irb:

$ irbtrue
=> nil
Expected:
false

Got:
Nothing, and programs won't exit.
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Thu, 15 Jan 2009 16:39:03 +0900
Von: Frisco Del Rosario <[email protected]>
An: (e-mail address removed)
Betreff: Prime.include?(1) hangs Ruby scripts and irb
Ruby version 1.8.6
Mac OS 10.5.2

I would like a Ruby script to do something if a result is a prime
number, or do something else if the result is not prime. But Ruby is
hanging on instance_of_Prime.includes?(some prime number). For example,
in irb:

$ irb
true
=> nil

Expected:
false

Got:
Nothing, and programs won't exit.

Hi --

I can confirm that behaviour on Ruby 1.8.7 and Ubuntu 8.04.
I think you should file a bug with the authors of mathn.

Best regards,

Axel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,970
Members
47,525
Latest member
emmawilsonpark

Latest Threads

Top