From maechler at stat.math.ethz.ch  Fri Jun 18 11:08:10 2004
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Fri Jun 18 11:08:12 2004
Subject: [Rd] is.integer() (PR#6984)
In-Reply-To: <40D1CCD7.2080209@dkfz-heidelberg.de>
References: <20040616144549.6AE271057A@slim.kubism.ku.dk>
	<40D1CCD7.2080209@dkfz-heidelberg.de>
Message-ID: <16594.45306.798287.841013@gargle.gargle.HOWL>

       {removed R-bugs from CC; as we've seen it's not a bug at all}

>>>>> "Wolfi" == Wolfgang Huber <w.huber@dkfz-heidelberg.de>
>>>>>     on Thu, 17 Jun 2004 18:54:47 +0200 writes:

    Wolfi> Hi Marcio,
    Wolfi> it's not a bug, it's a well-documented feature. In the S language, 
    Wolfi> numeric literals are floating point by default.

that hasn't been true for quite a while now:
In S-plus since version 5.0, these literals *are* integer.

    > mode(9)
    [1] "numeric"

and the above doesn't tell you anything, since the mode() of an
integer is "numeric" in any case.
You'd need  storage.mode(9) [S and R] or  typeof(9) [R only] to get the
``low-level mode''.

    > is.integer(9)
    [1] FALSE
    > is.integer(as.integer(9))
    [1] TRUE

BTW, I've been using the  9:9  `acronym' instead of as.integer(9)
in cases where it enhances readability {e.g. in formulas}.
But note that really you shouldn't care in almost all
situations.

Regards,
Martin Maechler

    Wolfi> Best wishes
    Wolfi> Wolfgang

    Wolfi> mmr@tci.ufal.br wrote:
    >> Hello!
    >> 
    >> I'm not sure if is it a BUG or not...
    >> I'm using R 1.9.0, and I used the command below:
    >> 
    >> 
    >>> is.integer(9)
    >> 
    >> [1] FALSE
    >> 
    >> R manual contains this words about the is.integer() function:
    >> 
    >> "is.integer returns TRUE or FALSE depending on whether its argument is of 
    >> integer type or not."
    >> 
    >> What's the problem? Am I wrong about the BUG report?
    >> 
    >> Thank you very much.
    >> 
    >> M?rcio de Medeiros Ribeiro
    >> Graduando em Ci?ncia da Computa??o
    >> Departamento de Tecnologia da Informa??o - TCI
    >> Universidade Federal de Alagoas - UFAL
    >> Macei? - Alagoas - Brasil
    >> Projeto CoCADa


[Rd] is.integer() (PR#6984)
Martin Maechler