Learn R Programming

Brobdingnag (version 1.2-9)

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

Author

Robin K. S. Hankin

Details

A Glubbdubdribian number is the Brobdingnagian equivalent of a complex number.

Function glub() takes two arguments that are coerced to Brobdingnagian numbers and returns a Glubbdubdribian 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
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