Full_Name: Jeremiah Cohen Version: 2.9.0 OS: Windows XP Submission from: (NULL) (129.59.230.235) I believe there is a bug in the seq() function for certain values of the "from" argument. Here are examples:> seq(-.2, .1, .1)[1] -0.2 -0.1 0.0 0.1> seq(-.3, .1, .1)[1] -3.000000e-01 -2.000000e-01 -1.000000e-01 5.551115e-17 1.000000e-01> seq(-.4, .1, .1)[1] -0.4 -0.3 -0.2 -0.1 0.0 0.1> seq(-.5, .1, .1)[1] -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1> seq(-.6, .1, .1)[1] -6.000000e-01 -5.000000e-01 -4.000000e-01 -3.000000e-01 -2.000000e-01 -1.000000e-01 1.110223e-16 1.000000e-01> seq(-.7, .1, .1)[1] -7.000000e-01 -6.000000e-01 -5.000000e-01 -4.000000e-01 -3.000000e-01 -2.000000e-01 -1.000000e-01 1.110223e-16 [9] 1.000000e-01> seq(-.8, .1, .1)[1] -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 So, for example,> which(seq(-.2, .1, .1) == 0)[1] 3> which(seq(-.3, .1, .1) == 0)integer(0) Here are the results of the "version" command on my machine: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 9.0 year 2009 month 04 day 17 svn rev 48333 language R version.string R version 2.9.0 (2009-04-17)
On 7/23/2009 3:30 PM, jeremiah.cohen at gmail.com wrote:> Full_Name: Jeremiah Cohen > Version: 2.9.0 > OS: Windows XP > Submission from: (NULL) (129.59.230.235)This is not a bug, it is yet another variation of FAQ 7.31. Duncan Murdoch> > > I believe there is a bug in the seq() function for certain values of the "from" > argument. Here are examples: > >> seq(-.2, .1, .1) > [1] -0.2 -0.1 0.0 0.1 >> seq(-.3, .1, .1) > [1] -3.000000e-01 -2.000000e-01 -1.000000e-01 5.551115e-17 1.000000e-01 >> seq(-.4, .1, .1) > [1] -0.4 -0.3 -0.2 -0.1 0.0 0.1 >> seq(-.5, .1, .1) > [1] -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 >> seq(-.6, .1, .1) > [1] -6.000000e-01 -5.000000e-01 -4.000000e-01 -3.000000e-01 -2.000000e-01 > -1.000000e-01 1.110223e-16 1.000000e-01 >> seq(-.7, .1, .1) > [1] -7.000000e-01 -6.000000e-01 -5.000000e-01 -4.000000e-01 -3.000000e-01 > -2.000000e-01 -1.000000e-01 1.110223e-16 > [9] 1.000000e-01 >> seq(-.8, .1, .1) > [1] -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 > > So, for example, > >> which(seq(-.2, .1, .1) == 0) > [1] 3 >> which(seq(-.3, .1, .1) == 0) > integer(0) > > Here are the results of the "version" command on my machine: > > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > major 2 > minor 9.0 > year 2009 > month 04 > day 17 > svn rev 48333 > language R > version.string R version 2.9.0 (2009-04-17) > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Please read how to report bugs (with recent version of R!) and read the FAQs (in thsi case FAQ "Why doesn't R think these numbers are equal?") and the mailing list archives before. Uwe Ligges jeremiah.cohen at gmail.com wrote:> Full_Name: Jeremiah Cohen > Version: 2.9.0 > OS: Windows XP > Submission from: (NULL) (129.59.230.235) > > > I believe there is a bug in the seq() function for certain values of the "from" > argument. Here are examples: > >> seq(-.2, .1, .1) > [1] -0.2 -0.1 0.0 0.1 >> seq(-.3, .1, .1) > [1] -3.000000e-01 -2.000000e-01 -1.000000e-01 5.551115e-17 1.000000e-01 >> seq(-.4, .1, .1) > [1] -0.4 -0.3 -0.2 -0.1 0.0 0.1 >> seq(-.5, .1, .1) > [1] -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 >> seq(-.6, .1, .1) > [1] -6.000000e-01 -5.000000e-01 -4.000000e-01 -3.000000e-01 -2.000000e-01 > -1.000000e-01 1.110223e-16 1.000000e-01 >> seq(-.7, .1, .1) > [1] -7.000000e-01 -6.000000e-01 -5.000000e-01 -4.000000e-01 -3.000000e-01 > -2.000000e-01 -1.000000e-01 1.110223e-16 > [9] 1.000000e-01 >> seq(-.8, .1, .1) > [1] -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 > > So, for example, > >> which(seq(-.2, .1, .1) == 0) > [1] 3 >> which(seq(-.3, .1, .1) == 0) > integer(0) > > Here are the results of the "version" command on my machine: > > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > major 2 > minor 9.0 > year 2009 > month 04 > day 17 > svn rev 48333 > language R > version.string R version 2.9.0 (2009-04-17) > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel