moochan です.

Interval クラスの最新版を添付します. # 何度もすみません^^;;;
変更内容確認のためのパッチも付けときます.

--- interval.rb.org	Thu Mar 11 15:53:03 1999
+++ interval.rb	Thu Mar 11 17:24:30 1999
@@ -2,7 +2,7 @@
 
 class Interval
   def initialize(beginning,ending,step=1)
-    reset!(beginning,ending,step)
+    reset(beginning,ending,step)
   end
   def reset(beginning,ending,step=1)
     @begin, @end, @step = beginning, ending, step
@@ -52,14 +52,12 @@
       yield clause(n)
     end
   end
-  def reverse
-    return set.reverse!
-  end
+  def reverse() return set.reverse!  end
   def maximum(a,b) return a if a > b; return b end
   private :maximum
   def prime
     ary = [2]
-    for i in 3..Math.sqrt(maximum(max,min))
+    for i in 3..Math.sqrt(maximum(max.abs,min.abs))
       for j in ary
         if j > Math.sqrt(i)
           ary.push(i)

---
moochan

IyEvdXNyL2xvY2FsL2Jpbi9ydWJ5CgpjbGFzcyBJbnRlcnZhbAogIGRlZiBpbml0aWFsaXplKGJl
Z2lubmluZyxlbmRpbmcsc3RlcD0xKQogICAgcmVzZXQoYmVnaW5uaW5nLGVuZGluZyxzdGVwKQog
IGVuZAogIGRlZiByZXNldChiZWdpbm5pbmcsZW5kaW5nLHN0ZXA9MSkKICAgIEBiZWdpbiwgQGVu
ZCwgQHN0ZXAgPSBiZWdpbm5pbmcsIGVuZGluZywgc3RlcAogICAgQGRpcmVjdGlvbiA9IDEKICAg
IEBkaXJlY3Rpb24gPSAtMSBpZiBAYmVnaW4gPiBAZW5kCiAgICBjaGVja19vZl9zdGVwCiAgZW5k
CiAgZGVmIGNoZWNrX29mX3N0ZXAKICAgIHJhaXNlICJJbnRlcnZhbCBzdGVwIHZhbHVlIGlzbid0
IHBvc2l0aXZlLiIgaWYgQHN0ZXAgPD0gMAogICAgcmFpc2UgIkludGVydmFsIHN0ZXAgaXMgdG9v
IGJpZy4iIGlmIChAZW5kIC0gQGJlZ2luKS5hYnMgPCBAc3RlcAogIGVuZAogIHByaXZhdGUgOmNo
ZWNrX29mX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gZmxhZyA9IDAKICAgICAg
ICAgIGJyZWFrCiAgICAgICAgZW5kCiAgICAgICAgaWYgbSAlIGogPT0gMAogICAgICAgICAgZmxh
ZyA9IDEKICAgICAgICAgIGJyZWFrCiAgICAgICAgZW5kCiAgICAgIGVuZAogICAgICBuZXcucHVz
aChuKSBpZiBmbGFnID09IDAKICAgIGVuZAogICAgcmV0dXJuIG5ldwogIGVuZAplbmQK