jim holtman wrote: > your number 6.6500000000000001 is to large to fit in a floating point > number. It takes 56 bits and there are only 54 in a real number so the > system see it as 6.65 and does the rounding to an even digit; 6.6 > > 6.650000000000001 does fit into a real number (takes 54 bits) and this will > now round to 6.7 > > Actually, a bit more insidious than that because 6.65 does not have an exact binary representation. Hence
> round(66.5) [1] 66 > round(6.65,1) [1] 6.7 > round(0.665,2) [1] 0.66 Notice that these are from Linux and differ from what you get on Windows. -- 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 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ [email protected] 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.
