]> gitweb.factorcode.org Git - factor.git/blobdiff - core/ranges/ranges.factor
ranges: fix exclusive ranges for float, ratio, etc.
[factor.git] / core / ranges / ranges.factor
index da78e6fcfef11756e4ef801ea23284b083868c53..45668c39aebd02918d53242ebc457084c03c7ca4 100644 (file)
@@ -49,7 +49,8 @@ M: range maximum
 
 : (a.. ( a b step -- a' b' step ) dup [ + ] curry 2dip ; inline
 
-: ..b) ( a b step -- a' b' step ) dup [ - ] curry dip ; inline
+: ..b) ( a b step -- a' b' step )
+    2over - over mod zero? [ dup [ - ] curry dip ] when ; inline
 
 PRIVATE>