summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-01-12 11:10:07 +0000
committerPeter Stephenson <pws@zsh.org>2015-01-12 11:10:07 +0000
commit626650f20e5c01fa6554da2a73dc5338a2523842 (patch)
tree987a6c6d4b9ea6bc5fcb2edb98fe80a00f9404bd
parent2753d49003006342e96b769422f7c50fd4093bde (diff)
downloadzsh-626650f20e5c01fa6554da2a73dc5338a2523842.tar.gz
zsh-626650f20e5c01fa6554da2a73dc5338a2523842.zip
34253: warn in zcalc doc about integer arithmetic.
C.f. warning in arithmetic doc in 34194.
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/contrib.yo14
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5bbdd175a..a9a44a379 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-12 Peter Stephenson <p.stephenson@samsung.com>
+
+ * 34253: Doc/Zsh/contrib.yo: warning on integer arithmetic
+ for zcalc, c.f. 34194.
+
2015-01-11 Barton E. Schaefer <schaefer@zsh.org>
* 34247: Test/C01arith.ztst: regression test for 34230.
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 50432432b..00ede52aa 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -3227,8 +3227,18 @@ A reasonably powerful calculator based on zsh's arithmetic evaluation
facility. The syntax is similar to that of formulae in most programming
languages; see
ifzman(the section `Arithmetic Evaluation' in zmanref(zshmisc))\
-ifnzman(noderef(Arithmetic Evaluation)) for details. The mathematical
-library tt(zsh/mathfunc) will be loaded if it is available; see
+ifnzman(noderef(Arithmetic Evaluation)) for details.
+
+Non-programmers should note that, as in many other programming
+languages, expressions involving only integers (whether constants
+without a `tt(.)', variables containing such constants as strings, or
+variables declared to be integers) are by default evaluated using
+integer arithmetic, which is not how an ordinary desk calculator
+operates. To force floating point operation, pass the option tt(-f);
+see further notes below.
+
+The mathematical library tt(zsh/mathfunc) will be loaded if it is
+available; see
ifzman(the section `The zsh/mathfunc Module' in zmanref(zshmodules))\
ifnzman(noderef(The zsh/mathfunc Module)). The mathematical functions
correspond to the raw system libraries, so trigonometric functions are