Full_Name: Claudio Version: 2.5.1 OS: windows Submission from: (NULL) (157.138.120.198) the command get a wrong result> trunc(2.3*100)229
focus17 at libero.it wrote:> Full_Name: Claudio > Version: 2.5.1 > OS: windows > Submission from: (NULL) (157.138.120.198) > > > the command get a wrong result > > >> trunc(2.3*100) >> > 229That is the correct answer. 2.3 is not representable exactly; the actual value used is slightly less. Duncan Murdoch
The result is correct. The representation of 2.3 is slightly less than 2.3: non-binary fractions cannot be represented exactly.> 2.3*100 - 230[1] -2.842171e-14 On Fri, 6 Jul 2007, focus17 at libero.it wrote:> Full_Name: Claudio > Version: 2.5.1 > OS: windows > Submission from: (NULL) (157.138.120.198) > > > the command get a wrong result > >> trunc(2.3*100) > 229 > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
focus17 at libero.it wrote:> Full_Name: Claudio > Version: 2.5.1 > OS: windows > Submission from: (NULL) (157.138.120.198) > > > the command get a wrong result > > >> trunc(2.3*100) >> > 229 > > __Not a bug, read FAQ 7.31 and the reference therein. -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907