The R Project SVN R

Rev

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

Rev 69423 Rev 69424
Line 137... Line 137...
137
plot(zz, xlim = c(-1,1), ylim = c(-1,1), col = "red", asp = 1,
137
plot(zz, xlim = c(-1,1), ylim = c(-1,1), col = "red", asp = 1,
138
     main = expression(paste("Rotation by "," ", pi == 180^o)))
138
     main = expression(paste("Rotation by "," ", pi == 180^o)))
139
abline(h = 0, v = 0, col = "blue", lty = 3)
139
abline(h = 0, v = 0, col = "blue", lty = 3)
140
points(zz.shift, col = "orange")
140
points(zz.shift, col = "orange")
141
 
141
 
142
showC <- function(z) noquote(sprintf("(R = %g, I = %g)", Re(z), Im(z)))
142
showC <- function(z) noquote(sprintf("(R = \%g, I = \%g)", Re(z), Im(z)))
143
 
143
 
144
## The exact result of this *depends* on the platform, compiler, math-library:
144
## The exact result of this *depends* on the platform, compiler, math-library:
145
(NpNA <- NaN + NA_complex_) ; str(NpNA) # *behaves* as 'cplx NA' ..
145
(NpNA <- NaN + NA_complex_) ; str(NpNA) # *behaves* as 'cplx NA' ..
146
stopifnot(is.na(NpNA), is.na(NA_complex_), is.na(Re(NA_complex_)), is.na(Im(NA_complex_)))
146
stopifnot(is.na(NpNA), is.na(NA_complex_), is.na(Re(NA_complex_)), is.na(Im(NA_complex_)))
147
showC(NpNA)# but not always is {shows  '(R = NaN, I = NA)' on some platforms}
147
showC(NpNA)# but not always is {shows  '(R = NaN, I = NA)' on some platforms}