From 5f4325a0a41987a92cee8b64a76e5b0d5e831f60 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 12 Jan 2015 16:38:00 +0000 Subject: Propagate float/integer type in arithmetic assignment. Add test. Mention this and also floating point mod change in README. --- Test/C01arith.ztst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Test') diff --git a/Test/C01arith.ztst b/Test/C01arith.ztst index 8da17f7f4..8e0730d8d 100644 --- a/Test/C01arith.ztst +++ b/Test/C01arith.ztst @@ -16,7 +16,7 @@ print -- $(( rnd = there * 10000 )) # save rounding problems by converting to integer 0:basic floating point arithmetic ->31415. +>31415 integer rnd (( rnd = ((29.1 % 13.0 * 10) + 0.5) )) @@ -300,3 +300,11 @@ print $(( 0b2 )) 1:Binary numbers don't tend to have 2's in ?(eval):1: bad math expression: operator expected at `2 ' + + integer varassi + print $(( varassi = 5.5 / 2.0 )) + print $varassi +0:Integer variable assignment converts result to integer +>2 +>2 +# It's hard to test for integer to float. -- cgit 1.4.1