diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index 55e6a31491..92d75604e0 100644 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -52,6 +52,9 @@ GENERIC: (eql?) ( obj1 obj2 -- ? ) M: integer (eql?) = ; +M: float (eql?) + over float? [ fp-bitwise= ] [ 2drop f ] if ; + M: sequence (eql?) over sequence? [ 2dup [ length ] bi@ = diff --git a/core/math/math.factor b/core/math/math.factor index 6a087ec909..da9bc4d1b5 100755 --- a/core/math/math.factor +++ b/core/math/math.factor @@ -81,6 +81,8 @@ TUPLE: complex { real real read-only } { imaginary real read-only } ; UNION: number real complex ; +: fp-bitwise= ( x y -- ? ) [ double>bits ] bi@ = ; inline + GENERIC: fp-special? ( x -- ? ) GENERIC: fp-nan? ( x -- ? ) GENERIC: fp-qnan? ( x -- ? )