From g.toedt at dkfz.de  Thu Oct 27 15:24:31 2005
From: g.toedt at dkfz.de (g.toedt@dkfz.de)
Date: Thu, 27 Oct 2005 15:24:31 +0200 (CEST)
Subject: [Rd] Critical Bug in type conversions: as.integer, trunc,
	... (PR#8255)
Message-ID: <20051027132431.7DC9022150@slim.kubism.ku.dk>

Full_Name: Grischa T?dt
Version: 2.1.1
OS: windows XP
Submission from: (NULL) (192.108.25.32)


I have a strange behaviour in R, looks like type conversions are messed up.

To reproduce:

expected:
> typeof(3)
[1] "double"

> as.integer(3)
[1] 3

!!!! strange:
> typeof((0.3/0.1))
[1] "double"

> as.integer((0.3/0.1))
[1] 2

also for trunc:
>trunc(c(5,7))
>c(0.5,0.7)/c(0.1,0.1)

and now watch the amazing!!!!:
>trunc((c(0.5,0.7)/c(0.1,0.1)))




My R-Version:
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    2              
minor    1.1            
year     2005           
month    06             
day      20             
language R



[Rd] Critical Bug in type conversions: as.integer, trunc, ... (PR#8255)
g.toedt@dkfz.de