[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [0][babel][R] Undesired conversion of integers to floats in R co

From: Daniel Drake
Subject: Re: [O] [0][babel][R] Undesired conversion of integers to floats in R code block output
Date: Sun, 19 Feb 2012 13:19:58 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120217 Thunderbird/10.0.2

On Sun 19 Feb 2012 12:46:15 PM PST, Eric Schulte wrote:

A further followup, at the risk of descending into minutia.  The
culprit seems to be the emacs function string-to-number.

On my 32-bit Arch machine:
(string-to-number "123456789"): 123456789 (#o726746425, #x75bcd15)
(string-to-number "987654321"): 987654321.0
GNU Emacs 23.4.1 (i686-pc-linux-gnu, GTK+ Version 2.24.9) of
2012-02-01 on shirley.hoetzel.info

On a 64-bit Ubuntu (11.10) machine:
(string-to-number "123456789"): 123456789 (#o726746425, #x75bcd15)
(string-to-number "987654321"): 987654321 (#o7267464261, #x3ade68b1)
GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.5) of
2011-08-14 on allspice, modified by Debian

Ah, nice debugging!

That must be the issue, as I'm working on a 64-bit machine.

Maybe one workaround could be to prefix the numbers with a letter in
R-land so that emacs interprets them as strings.


Poking around the web I found that emacs guarantees 28 bits as a minimum precision. For a while I did as you suggested, prefixing all subjects ids with 'id'. But it's cleaner if I reinstall a 64-bit version of Arch. From your experiments, I already know its 64-bit version of emacs supports at least 30 bits.

Thanks again for your help.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]