s-news
[Top] [All Lists]

Re: Calculation glitch?

To: "'Austin, Matt'" <maustin@amgen.com>, "'Steve Su'" <s.su@qut.edu.au>, s-news@lists.biostat.wustl.edu
Subject: Re: Calculation glitch?
From: "Liaw, Andy" <andy_liaw@merck.com>
Date: Fri, 27 Aug 2004 22:17:04 -0400
Perhaps it would be nice if Insightful can implement something like what the latest version of Python has: automatically extend to `long integer' when needed.  `Long integer' in Python has no upper limit.
 
Andy
-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Austin, Matt
Sent: Friday, August 27, 2004 9:56 PM
To: 'Steve Su'; s-news@lists.biostat.wustl.edu
Subject: Re: [S] Calculation glitch?

Steve,
 
You are battling something you can't win.  The threshold value which can cause undetected overflow errors is > 2^(b-1)-1 where b is 32 for 32-bit systems.  The largest value you can reliably represent as an integer is 2,147,483,647.  You can verify this with by looking at
 
> .Machine$integer.max
[1] 2147483647
 
The number of 2,147,483,648 could (would?) overflow and could go back to -1.
 
A decent intro reference for these kind of issues is Numerical Issues in Statistical Computing for the Social Scientist by Altman, Gill and McDonald.
 
--Matt

-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of Steve Su
Sent: Friday, August 27, 2004 18:30 PM
To: s-news@lists.biostat.wustl.edu
Subject: [S] Calculation glitch?

Dear All,
 
I am using SPLUS Professional Edition Version 6.0.3 Release 2 for Microsoft Windows XP.
 
I found that if I do:
 

>1000000*1500000

# I get:

[1] NA

 

A workaround is to do:

 

>1000000.0*1500000.0

[1] 1.5e+012

 

Is there a way I can correct for the above bug without putting decimal places?

 

Thank you for your attention.

 

PS. No luck in getting SPLUS 6.1 in my university yet, as they are out of licence!

 

Steve.

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
------------------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>