From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: org-babel: feature-request: allow table-cells to be passed as strings Date: Wed, 03 Nov 2010 14:12:45 -0600 Message-ID: <87oca6go8y.fsf@gmail.com> References: <8739sm9jby.fsf@gmail.com> <4CAA2587.1030509@online.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=41311 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDjhX-0007vr-JW for emacs-orgmode@gnu.org; Wed, 03 Nov 2010 16:12:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDjhU-0007fx-4G for emacs-orgmode@gnu.org; Wed, 03 Nov 2010 16:12:54 -0400 Received: from mail-gw0-f41.google.com ([74.125.83.41]:65399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDjhU-0007fk-1W for emacs-orgmode@gnu.org; Wed, 03 Nov 2010 16:12:52 -0400 Received: by gwb11 with SMTP id 11so917145gwb.0 for ; Wed, 03 Nov 2010 13:12:51 -0700 (PDT) In-Reply-To: <4CAA2587.1030509@online.de> (Marc-Oliver Ihm's message of "Mon, 04 Oct 2010 21:05:43 +0200") 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: Marc-Oliver Ihm Cc: emacs-orgmode@gnu.org Hi Marc, Sorry to stall this thread for so long. Now that I've worked some with Calc it seems that it provides a mature library of working with large numbers. My new hope is to convert Babel to using Calc for all of its numerical string parsing and printing. That should solve your dilemma in the most natural way. Does anyone foresee any problems in this potential approach? Thanks -- Eric Marc-Oliver Ihm writes: > Hello, > > This would be such an example. The Input table contains some numbers, > the last of them larger than allowed for an integer. > > As the result table show, the last one is converted to float thereby > using some precision. > > I would like to see them all as strings. > > with kind regards, Marc-Oliver Ihm > > > #+tblname: numbers > > | 1 | > | 2 | > | 12 | > | 45 | > | 166 | > | 12567890 | > | 231231282371983279389999999 | > > > #+begin_src emacs-lisp :var numbers=numbers > (mapcar > (lambda (line) > (let ((number (car line))) > (list number (type-of number)) > ) > ) > numbers) > #+end_src > > #+results: > | 1 | integer | > | 2 | integer | > | 12 | integer | > | 45 | integer | > | 166 | integer | > | 12567890 | integer | > | 2.3123128237198328e+26 | float | > > > > > Am 04.10.2010 15:30, schrieb Eric Schulte: >> Hi, >> >> Could you send an example of the contents of such a cell, and what it is >> converted to? Maybe it will be possible to improve the parsing of >> numerals in Babel s.t. we don't lose precision in these cases. >> >> Thanks -- Eric >> >> Marc-Oliver Ihm writes: >> >>> Hello ! >>> >>> Currently org-babel, when passing a table as input to a >>> source-code-block, behaves like this: >>> If the cell looks like a number, it will be converted to an integer or a >>> float. Otherwise the cell-content is passed unconverted as a string. >>> >>> Now, dealing with very large numbers (which I want to process with >>> calc), I found this behavior annoying, because babel converts my large >>> numbers to float, loosing precision in the process. >>> >>> Now my request would be, to have a switch (maybe as a header argument) >>> which would tell babel to pass all cells as unconverted strings. >>> >>> I have checked the documentation and the sources and have not been able >>> to find such a switch. >>> >>> >>> with kind regards, Marc-Oliver Ihm >>> >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Please use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>