Brobdingnag (version 1.2-6)

glub: Glubbdubdribian numbers: complex numbers with Brobdingnagian real and imaginary parts

Description

Create, coerce to or test for a Glubbdubdribian object

Usage

glub(real = double(), imag = double())
as.glub(x)
is.glub(x)

Arguments

real, imag

Real and imaginary components of complex number: must be Brobdingnagian numbers

x

object to be coerced to or tested for Glubbdubdribian form

Details

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.

See Also

brob

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab