about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-06-27 10:22:11 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-06-27 10:22:11 +0000
commit42fc33e2f852daea34c3bfca5c3c3753b8bd732a (patch)
treeace7f391c176343778eb8f917394de77cf50976c /Doc
parentee46f1391ff1b50de1c550646f2608003c6c8a74 (diff)
downloadzsh-42fc33e2f852daea34c3bfca5c3c3753b8bd732a.tar.gz
zsh-42fc33e2f852daea34c3bfca5c3c3753b8bd732a.tar.xz
zsh-42fc33e2f852daea34c3bfca5c3c3753b8bd732a.zip
21387: zcalc documentation for precision features
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/contrib.yo26
1 files changed, 25 insertions, 1 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 2303dccfc..f9297ffd6 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -1487,7 +1487,9 @@ An extra facility is provided for changing the default output base.  Use,
 for example, `tt([#16])' to display hexadecimal output preceded by an
 indication of the base, or `tt([##16])' just to display the raw number in
 the given base.  Bases themselves are always specified in decimal.
-`tt([#])' restores the normal output format.
+`tt([#])' restores the normal output format.  Note that setting an output
+base suppresses floating point output; use `tt([#])' to return to normal
+operation.
 
 The output base can be initialised by passing the option `tt(-#)var(base)',
 for example `tt(zcalc -#16)' (the `tt(#)' may have to be quoted, depending
@@ -1499,6 +1501,28 @@ stored locally in the first element of the array tt(psvar), which can be
 referred to in tt(ZCALCPROMPT) as `tt(%1v)'.  The default prompt is
 `tt(%1v> )'.
 
+The output precision may be specified within zcalc by special commands
+familiar from many calculators:
+startitem()
+item(tt(norm))(
+The default output format.  It corresponds to the printf tt(%g)
+specification.  Typically this shows six decimal digits.
+)
+item(tt(sci) var(digits))(
+Scientific notation, corresponding to the printf tt(%g) output format with
+the precision given by var(digits).  This produces either fixed point or
+exponential notation depending on the value output.
+)
+item(tt(fix) var(digits))(
+Fixed point notation, corresponding to the printf tt(%f) output format with
+the precision given by var(digits).
+)
+item(tt(eng) var(digits))(
+Exponential notation, corresponding to the printf tt(%E) output format with
+the precision given by var(digits).
+)
+enditem()
+
 See the comments in the function for a few extra tips.
 )
 findex(zed)