diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2012-09-11 16:02:41 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2012-09-11 16:02:41 +0000 |
commit | e550c98d69a270a9c6623fe1fd602b5081f4b46c (patch) | |
tree | 40facf8ba2d330dc9e6c5a2a101ddac398563818 /Doc | |
parent | d88365d964cb521097f70efb21935a776659a7ed (diff) | |
download | zsh-e550c98d69a270a9c6623fe1fd602b5081f4b46c.tar.gz zsh-e550c98d69a270a9c6623fe1fd602b5081f4b46c.tar.xz zsh-e550c98d69a270a9c6623fe1fd602b5081f4b46c.zip |
30647, 30649: allow underscores in numeric constants
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Zsh/arith.yo | 10 |
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) |