From b9d2c068a447e9d95096936599cc1e81712b165d Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 17 Oct 2009 16:54:51 -0500 Subject: [PATCH] fix sporadic "fall-through in cond" failure in float math.vectors.simd tests --- basis/math/vectors/simd/simd-tests.factor | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/basis/math/vectors/simd/simd-tests.factor b/basis/math/vectors/simd/simd-tests.factor index 71ad09e002..8d0b88c393 100644 --- a/basis/math/vectors/simd/simd-tests.factor +++ b/basis/math/vectors/simd/simd-tests.factor @@ -193,22 +193,18 @@ CONSTANT: simd-classes '[ first2 inputs _ _ check-vector-op ] ] dip check-optimizer ; inline -: approx= ( x y -- ? ) +: (approx=) ( x y -- ? ) { { [ 2dup [ fp-nan? ] both? ] [ 2drop t ] } - { [ 2dup [ float? ] both? ] [ -1.e8 ~ ] } + { [ 2dup [ fp-nan? ] either? ] [ 2drop f ] } { [ 2dup [ fp-infinity? ] either? ] [ fp-bitwise= ] } - { [ 2dup [ sequence? ] both? ] [ - [ - { - { [ 2dup [ fp-nan? ] both? ] [ 2drop t ] } - { [ 2dup [ fp-infinity? ] either? ] [ fp-bitwise= ] } - { [ 2dup [ fp-nan? ] either? not ] [ -1.e8 ~ ] } - } cond - ] 2all? - ] } + { [ 2dup [ float? ] both? ] [ -1.e8 ~ ] } } cond ; +: approx= ( x y -- ? ) + 2dup [ sequence? ] both? + [ [ (approx=) ] 2all? ] [ (approx=) ] if ; + : exact= ( x y -- ? ) { { [ 2dup [ float? ] both? ] [ fp-bitwise= ] }