No subject

Bendix Carstensen bxc at svs.dk
Fri Feb 26 10:59:39 CET 1999


When you require 2 digits you expect to find 5.96 printed
as 6.0, i.e. a number somewhere between 5.95 and 6.04999999999999.
This is apparently not always the case for R.
Why does 0 have a special status as trailing digit?

> options(digits=2)
> x <- c(59.6,59.4)
> x
[1] 60 59
> x/10
[1] 6.0 5.9
> x[1]/10
[1] 6
                              \\\|///
                            \\  - -  //
                             (  @ @  )
+--------------------------o00o-(_)-o00o-----------------------+
| Bendix Carstensen                                            |
| Statistiker                                 tlf: 35 30 01 00 |
| Dansk Zoonosecenter                         dir: 35 30 01 39 |
| Statens Veterinære serumlaboratorium        fax: 35 30 01 20 |
| Bülowsvej 27                             e-mail: bxc at svs.dk  |
| 1790 København V                 Ooooo                       |
+-------------------------ooooO----(   )-----------------------+
                          (   )     ) /
                           \ (     (_/
                            \_)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list