From 2740fa0342c11481e3dad18c775a1aa0b862e8d8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 1 Nov 2015 18:50:26 -0800 Subject: test conversions --- test/float_ops.txt | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'test/float_ops.txt') diff --git a/test/float_ops.txt b/test/float_ops.txt index 35106b6e7..768be6061 100644 --- a/test/float_ops.txt +++ b/test/float_ops.txt @@ -8,6 +8,16 @@ dfloor -1.4 ==> -2 1.6 ==> 1 -1.6 ==> -2 + 5.1 ==> 5 + 5.3 ==> 5 + 5.7 ==> 5 + 5.9 ==> 5 + -1 ==> -1 + 0 ==> 0 + -2 ==> -2 + 4294967295 ==> 4294967295 + 4294967296 ==> 4294967296 + 4294967294 ==> 4294967294 dadd 0,0 ==> 0 0,1 ==> 1 @@ -284,4 +294,64 @@ dge -1,5.123 ==> 0 5,-1.123 ==> 1 -1,-1.123 ==> 1 +int_to_double + 0 ==> 1.23 + 1 ==> 2.23 + -1 ==> 0.22999999999999998 + 0.5 ==> 1.23 + -0.5 ==> 1.23 + 1.4 ==> 2.23 + -1.4 ==> 0.22999999999999998 + 1.6 ==> 2.23 + -1.6 ==> 0.22999999999999998 + 5.1 ==> 6.23 + 5.3 ==> 6.23 + 5.7 ==> 6.23 + 5.9 ==> 6.23 + -1 ==> 0.22999999999999998 + 0 ==> 1.23 + -2 ==> -0.77 + 4294967295 ==> 0.22999999999999998 + 4294967296 ==> 1.23 + 4294967294 ==> -0.77 +uint_to_double + 0 ==> 1.23 + 1 ==> 2.23 + -1 ==> 4294967296.23 + 0.5 ==> 1.23 + -0.5 ==> 1.23 + 1.4 ==> 2.23 + -1.4 ==> 4294967296.23 + 1.6 ==> 2.23 + -1.6 ==> 4294967296.23 + 5.1 ==> 6.23 + 5.3 ==> 6.23 + 5.7 ==> 6.23 + 5.9 ==> 6.23 + -1 ==> 4294967296.23 + 0 ==> 1.23 + -2 ==> 4294967295.23 + 4294967295 ==> 4294967296.23 + 4294967296 ==> 1.23 + 4294967294 ==> 4294967295.23 +double_to_int + 0 ==> 1 + 1 ==> 2 + -1 ==> 0 + 0.5 ==> 1 + -0.5 ==> 0 + 1.4 ==> 2 + -1.4 ==> 0 + 1.6 ==> 2 + -1.6 ==> 0 + 5.1 ==> 6 + 5.3 ==> 6 + 5.7 ==> 6 + 5.9 ==> 7 + -1 ==> 0 + 0 ==> 1 + -2 ==> 0 + 4294967295 ==> 0 + 4294967296 ==> 1 + 4294967294 ==> -1 done. -- cgit v1.2.3