]> gitweb.factorcode.org Git - factor.git/commitdiff
change math.floats.env tests not to use any libm functions, which don't reliably...
authorJoe Groff <arcata@gmail.com>
Wed, 9 Sep 2009 23:00:38 +0000 (18:00 -0500)
committerJoe Groff <arcata@gmail.com>
Wed, 9 Sep 2009 23:00:38 +0000 (18:00 -0500)
basis/math/floats/env/env-tests.factor

index 08a7621e886cb0d3396069c706eb154647a9637b..231eba919c102f0bc3eae90d6854e8248ac95e53 100644 (file)
@@ -1,5 +1,5 @@
 USING: kernel math math.floats.env math.floats.env.private
-math.functions math.libm sets tools.test ;
+math.functions math.libm sets sequences tools.test ;
 IN: math.floats.env.tests
 
 : set-default-fp-env ( -- )
@@ -19,17 +19,17 @@ set-default-fp-env
 ] unit-test
 
 [ t ] [
-    [ 2.0 100,000.0 ^ drop ] collect-fp-exceptions
-    { +fp-inexact+ +fp-overflow+ } set= 
+    [ 1.0e250 1.0e100 * drop ] collect-fp-exceptions
+    +fp-overflow+ swap member?
 ] unit-test
 
 [ t ] [
-    [ 2.0 -100,000.0 ^ drop ] collect-fp-exceptions
-    { +fp-inexact+ +fp-underflow+ } set= 
+    [ 1.0e-250 1.0e-100 * drop ] collect-fp-exceptions
+    +fp-underflow+ swap member?
 ] unit-test
 
 [ t ] [
-    [ -1.0 fsqrt drop ] collect-fp-exceptions
+    [ 0.0 0.0 /f drop ] collect-fp-exceptions
     { +fp-invalid-operation+ } set= 
 ] unit-test