summaryrefslogtreecommitdiff
path: root/Test/C01arith.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-01-12 16:38:00 +0000
committerPeter Stephenson <pws@zsh.org>2015-01-12 16:38:00 +0000
commit5f4325a0a41987a92cee8b64a76e5b0d5e831f60 (patch)
tree8d66f0afe363b606c5841aff3c0c8869c2da4c4d /Test/C01arith.ztst
parent626650f20e5c01fa6554da2a73dc5338a2523842 (diff)
downloadzsh-5f4325a0a41987a92cee8b64a76e5b0d5e831f60.tar.gz
zsh-5f4325a0a41987a92cee8b64a76e5b0d5e831f60.zip
Propagate float/integer type in arithmetic assignment.
Add test. Mention this and also floating point mod change in README.
Diffstat (limited to 'Test/C01arith.ztst')
-rw-r--r--Test/C01arith.ztst10
1 files changed, 9 insertions, 1 deletions
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.