]> gitweb.factorcode.org Git - factor.git/commitdiff
Revert "math.intervals: workaround possible compiler bug by widening interval-bitor."
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 17 Mar 2021 04:21:53 +0000 (21:21 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 17 Mar 2021 04:21:53 +0000 (21:21 -0700)
This reverts commit e256a4ba18fbb7916db2a22ead55cbcbf7cf920d.

basis/math/intervals/intervals-tests.factor
basis/math/intervals/intervals.factor

index 87028ea93f4b34a5730587c4fed3d4bde4b779d4..73706da34052576ea91438621a3f831ac60c3cb2 100644 (file)
@@ -413,8 +413,8 @@ ${ 0 0xff [a,b] } [ -0xff -1 [a,b] 0 0xff [a,b] interval-bitand ] unit-test
     [ 0 15 [a,b] interval-contains? ] all?
 ] unit-test
 
-${ 0 256 [a,b] } [ 0 255 [a,b] dup interval-bitor ] unit-test
-${ 0 512 [a,b] } [ 0 256 [a,b] dup interval-bitor ] unit-test
+${ 0 255 [a,b] } [ 0 255 [a,b] dup interval-bitor ] unit-test
+${ 0 511 [a,b] } [ 0 256 [a,b] dup interval-bitor ] unit-test
 
 ${ -128 127 [a,b] } [ -128 127 [a,b] dup interval-bitor ] unit-test
 ${ -256 255 [a,b] } [ -128 128 [a,b] dup interval-bitor ] unit-test
index f36b659b3b0fe5ae47bae9e11e30f15369b5444d..63fa4582fd3df8b331fccd46efc107daa307327f 100644 (file)
@@ -447,8 +447,7 @@ PRIVATE>
 : interval-bitor ( i1 i2 -- i3 )
     [
         { { [ 2dup [ interval-nonnegative? ] both? ]
-            ! FIXME: this should maybe be bitweight 1 -
-            [ [ max-lower-bound ] [ max-upper-bound ] 2bi bit-weight [a,b] ] }
+            [ [ max-lower-bound ] [ max-upper-bound ] 2bi bit-weight 1 - [a,b] ] }
           { [ 2dup [ interval-negative? ] both? ]
             [ max-lower-bound -1 [a,b] ] }
           [ interval-union interval-bit-weight [ neg ] [ 1 - ] bi [a,b] ]