The R Project SVN R

Rev

Rev 59039 | Rev 68948 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59039 Rev 61150
Line 80... Line 80...
80
as.character(form)  ## length 3
80
as.character(form)  ## length 3
81
deparse(form)       ## like the input
81
deparse(form)       ## like the input
82
 
82
 
83
a0 <- 11/999          # has a repeating decimal representation
83
a0 <- 11/999          # has a repeating decimal representation
84
(a1 <- as.character(a0))
84
(a1 <- as.character(a0))
85
format(a0, digits=16) # shows one more digit
85
format(a0, digits = 16) # shows one more digit
86
a2 <- as.numeric(a1)
86
a2 <- as.numeric(a1)
87
a2 - a0               # normally around -1e-17
87
a2 - a0               # normally around -1e-17
88
as.character(a2)      # normally different from a1
88
as.character(a2)      # normally different from a1
89
print(c(a0, a2), digits = 16)
89
print(c(a0, a2), digits = 16)
90
}
90
}