]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix negative zero smashing with bootstrap
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 9 May 2009 23:17:30 +0000 (18:17 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 9 May 2009 23:17:30 +0000 (18:17 -0500)
basis/bootstrap/image/image.factor
core/math/math.factor

index 55e6a31491d362a44dd4afdb79ad03cf1ac45d18..92d75604e08c0845afab6ccac8813f0a71124547 100644 (file)
@@ -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@ =
index 6a087ec9091f00f72a64a2ff2475f0fdd5d73f9c..da9bc4d1b5346fa61f266b12d5041aabc0e3318e 100755 (executable)
@@ -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 -- ? )