Re: [R] Integer manipulation

2003-03-21 Thread Thomas Lumley
On Fri, 21 Mar 2003, Wayne Jones wrote:

> Hi there,
>
> When I enter a particularly long number into R it rounds it down into
> scientific notation.
> For example,
>
> > 251002679
>
> [1] 2.51e+12
>
> How can I preserve the precision of the original number?

It has been preserved:
> a<-251002679
> 25100-a
[1] -2679

For numbers above 2^31 (or whatever .Machine$integer.max is), you have to
use floating point, which gives you about 15 digits accuracy.

If you want to print a number to more digits than the default, use the
digits= option to print(), or change options(digits)

-thomas

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Integer manipulation

2003-03-21 Thread Wayne Jones
Hi there, 

When I enter a particularly long number into R it rounds it down into
scientific notation.
For example, 

> 251002679

[1] 2.51e+12

How can I preserve the precision of the original number?

Regards, 

Wayne



Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713



KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may b... [[dropped]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help