From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Precision setting for spreadsheet calculation Date: Wed, 3 Mar 2010 13:20:09 +0100 Message-ID: References: <4B882C11.90406@alumni.ethz.ch> <0AEABCAD-CA2E-4F84-99E1-B5670FEC1E8D@gmail.com> <4B88395A.3040501@alumni.ethz.ch> <034F9F11-0888-48F4-9621-B7FC4907850F@gmail.com> <4B88440B.9060203@alumni.ethz.ch> <7649555B-447F-486D-94A4-2139971A7AA9@gmail.com> <4B88D3C5.9010306@alumni.ethz.ch> <4B8D71FE.3000300@alumni.ethz.ch> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmnYr-0002gb-5f for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 07:20:21 -0500 Received: from [140.186.70.92] (port=37125 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmnYo-0002dv-QB for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 07:20:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NmnYo-0003d6-3t for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 07:20:18 -0500 Received: from mail-ew0-f222.google.com ([209.85.219.222]:41727) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmnYn-0003cy-Vg for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 07:20:18 -0500 Received: by ewy22 with SMTP id 22so999971ewy.26 for ; Wed, 03 Mar 2010 04:20:17 -0800 (PST) In-Reply-To: <4B8D71FE.3000300@alumni.ethz.ch> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Brand Cc: emacs-orgmode@gnu.org Hi Michael, very nice, thanks, I have applied the patch. - Carsten On Mar 2, 2010, at 9:15 PM, Michael Brand wrote: > Hi Carsten > > Michael Brand wrote: >> Yes, within a few days I will come back with this and/or a texinfo >> patch for the Org info manual, at least chapter "3.5.2 Formula >> syntax for Calc". > > The patch below is my proposal for the manual. Please feel free to > improve it. > > I also played around quite a bit with the precision settings and > will put the resulting examples into the Worg FAQ. But I would like > to postpone my Worg FAQ update because its link to the manual would > be confusing before the manual update itself will have been made. > > Is there a small issue with the behavior of the section link > http://orgmode.org/manual/index.html#Top ? > With Firefox 3.0.5 it sometimes jumps to where the html source > fragment > > lies like expected but sometimes it jumps to where the html source > fragment > > lies which could be annoying. > > Michael > > > patch for org.texi, `---' file was taken from org-version 6.34c: > = > = > = > = > = > = > = > ====================================================================== > --- a/doc/org.texi 2010-01-18 00:10:46.000000000 +0100 > +++ b/doc/org.texi 2010-03-02 20:00:00.000000000 +0100 > @@ -2128,8 +2128,11 @@ > @code{org-calc-default-modes}. > > @example > -p20 @r{switch the internal precision to 20 digits} > -n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display > format} > +p20 @r{set the internal Calc calculation precision to 20 > digits} > +n3 s3 e2 f4 @r{Normal, scientific, engineering, or fixed} > + @r{format of the result of Calc passed back to Org.} > + @r{Calc formatting is unlimited in precision as} > + @r{long as the Calc calculation precision is greater.} > D R @r{angle modes: degrees, radians} > F S @r{fraction and symbolic modes} > N @r{interpret all fields as numbers, use 0 for non- > numbers} > @@ -2139,8 +2142,16 @@ > @end example > > @noindent > -In addition, you may provide a @code{printf} format specifier to > -reformat the final result. A few examples: > +Unless you use large integer numbers or high-precision-calculation > +and -display for floating point numbers you may alternatively > provide a > +@code{printf} format specifier to reformat the Calc result after it > has been > +passed back to Org instead of letting Calc already do the > +formatting@footnote{The @code{printf} reformatting is limited in > precision > +because the value passed to it is converted into an @code{integer} or > +@code{double}. The @code{integer} is limited in size by truncating > the > +signed value to 32 bits. The @code{double} is limited in precision > to 64 > +bits overall which leaves approximately 16 significant decimal > digits.}. > +A few examples: > > @example > $1+$2 @r{Sum of first and second field} > = > = > = > = > = > = > = > ====================================================================== > - Carsten