quote:
No doubt, 7.0 is integer in math. But if people can write 7 why people need to write 7.0 (I do not see any reason to do this).
endquote

First off, in physics, engineering, chem, etc. there is a well-known rule that 7 implies an error of +/- 0.5 while 7.0 implies an error of +/-0.05 . (actually, the preferred notation is x.yEz so that the physical size of the number doesn't cause a bunch of zeroes to imply false precision)

Next, aside from storage reasons (if you're writing machine code or comms packet code), there are times when one wishes to stay in the integer world as opposed to the floating-point world. There's tons of literature out there about binary representation of floats, binary-coded-decimal, and on and on.


Carl

______________________________________________
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.

Reply via email to