The R Project SVN R

Rev

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

Rev 35250 Rev 35253
Line 14... Line 14...
14
a <- -4:12
14
a <- -4:12
15
m <- outer(a +0i, b <- seq(-.5,2, by=.5), "^")
15
m <- outer(a +0i, b <- seq(-.5,2, by=.5), "^")
16
dimnames(m) <- list(paste(a), "^" = sapply(b,format))
16
dimnames(m) <- list(paste(a), "^" = sapply(b,format))
17
round(m,3)
17
round(m,3)
18
 
18
 
-
 
19
## fft():
-
 
20
for(n in 1:30) cat("\nn=",n,":", round(fft(1:n), 8),"\n")
-
 
21
 
19
 
22
 
20
## Complex Trig.:
23
## Complex Trig.:
21
Meps <- .Machine$double.eps
24
Meps <- .Machine$double.eps
22
abs(Im(cos(acos(1i))) -	 1) < 2*Meps
25
abs(Im(cos(acos(1i))) -	 1) < 2*Meps
23
abs(Im(sin(asin(1i))) -	 1) < 2*Meps
26
abs(Im(sin(asin(1i))) -	 1) < 2*Meps