On Sat, 2009-05-02 at 10:34 -0700, bogdanno wrote: > It seems division with numbers bigger than 10 000 000 doesn't work > 20000000/21 > [1] 952381 > > 55555555/23 > [1] 2415459 > > Thank you
Hi bogdanno First of all look this > all.equal(21*20000000/21,20000000) [1] TRUE So de division work correctly but if I type > all.equal(952381*21,20000000) [1] "Mean relative difference: 5e-08" It's not means R division don't work correctly if you use the command > format(20000000/21,digits=22) [1] "952380.952380952 So the result: 952381 is a round number not a real result of division. This occur because R print only 7 significants digits in numbers, if you test > all.equal(21*952380.952380952,20000000) [1] TRUE -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.