[R] A simple question??
HoiNam
hiebsra at hotmail.com
Tue Mar 7 07:10:18 CET 2000
Dear all,
I'm currently use R v0.99 on Windows 98 Second Edition. I have a question on some simple calculations. I wonder that I've done something wrong with the calculation.
Here is the imput commands:
> a <- 25.01
> b <- 56.08
> a.trunc <- trunc(a)
> b.trunc <- trunc(b)
> a.tail <- a - a.trunc
> b.tail <- b - b.trunc
> a.trunc
[1] 25
> b.trunc
[1] 56
> a.tail
[1] 0.01
> b.tail
[1] 0.08
> a.tail <- (a - a.trunc) * 100
> b.tail <- (b - b.trunc) * 100
> a.tail
[1] 1
> b.tail
[1] 8
> N <- ( (b.trunc - a.trunc) * 12 ) + (b.tail - a.tail)
> N
[1] 379
> N == 379
[1] FALSE
According to the above command and output, the value of N is equal to 379, but when I set the condition 'N == 379' R gives "FALSE" as the result. How do I avoid this problem?? I do the same thing in S-plus 4.0 release 3 on Win98 SE and obtained the same result.
I look forward to hear your reply.
Thank you in advance for your time.
Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20000307/c3016a7c/attachment.html
More information about the R-help
mailing list