On Tue, 24 Jan 2006, Taka Matzmoto wrote:

> Hi R users
> I have a simple question to ask.
> Why am I getting FALSE on this
>
>> is.integer(10)
> [1] FALSE
>
> 10 is a integer number.

is.integer() asks how a number is stored, not whether the number happens 
to be an integer.  Explicit numbers typed into R are stored as double 
precision even if they happen to be whole numbers.  This is historical but 
is also useful: the double precision type can hold integers up to 2^52 
exactly and the integer type can only hold integers up to 2^31.

        -thomas

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to