Dear Splus users,
I would like to evaluate trigonometric functions (e.g., sin, cos) for
a really large argument.
And it is interesting to know the following:
> sin(1e+14)
[1] -0.20940830749645
> sin(1e+15)
[1] NA
Warning messages:
NAs generated in: sin(1e+15)
> sin(4.5035996e+14)
[1] 0.99812756524116
> sin(4.5035997e+14)
[1] NA
Warning messages:
NAs generated in: sin(1e+15)
So, there is a threshold over which I cannot evaluate sin, cos, tan, etc.
I would greatly appreciate it if you could tell me why this happens, and
how to circumvent this problem.
Incidentally, on matlab, I do not have any problems like this.
Thank you very much for your help!
Naoki Saito
--
Naoki Saito, Ph.D., Professor, Department of Mathematics
University of California, One Shields Avenue, Davis, CA 95616-8633 USA
Voice: 530-754-2121, Fax: 530-752-6635, Email: saito@math.ucdavis.edu
Home Page: http://math.ucdavis.edu/~saito/
|