glub {Brobdingnag} | R Documentation |
Create, coerce to or test for a Glubbdubdribian object
glub(real = double(), imag = double()) as.glub(x) is.glub(x)
real, imag |
Real and imaginary components of complex number: must be Brobdingnagian numbers |
x |
object to be coerced to or tested for Glubbdubdribian form |
Function glub()
takes two arguments that are coerced to
Brobdingnagian numbers and returns a complex number. This function is
not really intended for the end user: it is confusing and includes no
argument checking. Use function as.glub()
instead.
Function as.glub()
is the user's workhorse: use this to coerce
numeric or complex vectors to Glubbdubdribian form.
Function is.glub()
tests for its arguments being Glubbdubdribian.
Function glub()
uses recycling inherited from cbind()
.
Robin K. S. Hankin
a <- as.glub(1:10 + 5i) a^2 - a*a f <- function(x){sin(x) +x^4 - 1/x} as.complex(f(a)) - f(as.complex(a)) # should be zero (in the first # term, f() works with glubs and coerces to # complex; in the second, f() # works with complex numbers directly)