about summary refs log tree commit diff
path: root/Doc/Zsh/arith.yo
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-09-11 16:02:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-09-11 16:02:41 +0000
commite550c98d69a270a9c6623fe1fd602b5081f4b46c (patch)
tree40facf8ba2d330dc9e6c5a2a101ddac398563818 /Doc/Zsh/arith.yo
parentd88365d964cb521097f70efb21935a776659a7ed (diff)
downloadzsh-e550c98d69a270a9c6623fe1fd602b5081f4b46c.tar.gz
zsh-e550c98d69a270a9c6623fe1fd602b5081f4b46c.tar.xz
zsh-e550c98d69a270a9c6623fe1fd602b5081f4b46c.zip
30647, 30649: allow underscores in numeric constants
Diffstat (limited to 'Doc/Zsh/arith.yo')
-rw-r--r--Doc/Zsh/arith.yo10
1 files changed, 9 insertions, 1 deletions
diff --git a/Doc/Zsh/arith.yo b/Doc/Zsh/arith.yo
index dd18ee720..2674c7817 100644
--- a/Doc/Zsh/arith.yo
+++ b/Doc/Zsh/arith.yo
@@ -48,6 +48,12 @@ The var(base)tt(#) may also be omitted, in which case
 base 10 is used.  For backwards compatibility the form
 `tt([)var(base)tt(])var(n)' is also accepted.
 
+An integer expression or a base given in the form
+`var(base)tt(#)var(n)' may contain underscores (`tt(_)') after the
+leading digit for visual guidance; these are ignored in computation.
+Examples are tt(1_000_000) or tt(0xffff_ffff) which are equivalent to
+tt(1000000) and tt(0xffffffff) respectively.
+
 It is also possible to specify a base to be used for output in the form
 `tt([#)var(base)tt(])', for example `tt([#16])'.  This is used when
 outputting arithmetical substitutions or when assigning to scalar
@@ -87,7 +93,9 @@ output is valid syntax for input.  If the tt(#) is doubled, for example
 Floating point constants are recognized by the presence of a decimal point
 or an exponent.  The decimal point may be the first character of the
 constant, but the exponent character tt(e) or tt(E) may not, as it will be
-taken for a parameter name.
+taken for a parameter name.  All numeric parts (before and after the
+decimal point and in the exponent) may contain underscores after the
+leading digit for visual guidance; these are ignored in computation.
 
 cindex(arithmetic operators)
 cindex(operators, arithmetic)