From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18978 invoked from network); 27 Jun 2005 10:18:16 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Jun 2005 10:18:16 -0000 Received: (qmail 56716 invoked from network); 27 Jun 2005 10:18:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Jun 2005 10:18:10 -0000 Received: (qmail 18621 invoked by alias); 27 Jun 2005 10:18:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21387 Received: (qmail 18612 invoked from network); 27 Jun 2005 10:18:07 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 Jun 2005 10:18:07 -0000 Received: (qmail 56385 invoked from network); 27 Jun 2005 10:18:07 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 27 Jun 2005 10:18:02 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Mon, 27 Jun 2005 11:16:05 +0100 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 27 Jun 2005 11:19:05 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j5RAI7Ni007859 for ; Mon, 27 Jun 2005 11:18:07 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j5RAI7Og007856 for ; Mon, 27 Jun 2005 11:18:07 +0100 Message-Id: <200506271018.j5RAI7Og007856@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: zcalc doc Date: Mon, 27 Jun 2005 11:18:07 +0100 From: Peter Stephenson X-OriginalArrivalTime: 27 Jun 2005 10:19:05.0198 (UTC) FILETIME=[A583A8E0:01C57B01] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 This documents some existing features of zcalc. Index: Doc/Zsh/contrib.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/contrib.yo,v retrieving revision 1.42 diff -u -r1.42 contrib.yo --- Doc/Zsh/contrib.yo 23 May 2005 10:11:28 -0000 1.42 +++ Doc/Zsh/contrib.yo 27 Jun 2005 10:04:21 -0000 @@ -1487,7 +1487,9 @@ 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 @@ 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) -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************