From maechler at stat.math.ethz.ch  Tue May  1 14:37:21 2007
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Tue, 1 May 2007 14:37:21 +0200
Subject: [Rd] integer constants given by hexadecimal notation
In-Reply-To: <1ae51efd0705010421g6d591837y14885e4e06d43b5e@mail.gmail.com>
References: <1ae51efd0705010421g6d591837y14885e4e06d43b5e@mail.gmail.com>
Message-ID: <17975.13441.150050.206821@stat.math.ethz.ch>

>>>>> "Stephan" == Stephan  <orcaforge at googlemail.com>
>>>>>     on Tue, 1 May 2007 13:21:53 +0200 writes:

    Stephan> Hi,
    >> 0x10L
    Stephan> returns: int 0


    Stephan> I would expect: int 16?  This happens with all
    Stephan> integer constants given by hexadecimal notation.
    Stephan> It's a bug?

a bug in your installed version of R I think

    >> sessionInfo()
    Stephan> R version 2.5.0 (2007-04-23) i386-pc-mingw32

    Stephan> locale:
    Stephan> LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252

    Stephan> attached base packages: [1] "stats" "graphics"
    Stephan> "grDevices" "utils" "datasets" "methods" [7] "base"

In my (Linux) versions of R 2.5.0, I see

  $ Rscript --vanilla -e 'str(0x10L)'
  int 16

Martin Maechler, ETH Zurich



[Rd] integer constants given by hexadecimal notation
Martin Maechler