The DESCRIPTION file:
tools:::Rd_package_DESCRIPTION("Brobdingnag")
tools:::Rd_package_indices("Brobdingnag")
Real numbers are represented by two objects: a real, holding the
logarithm of their absolute values; and a logical, indicating the
sign. Multiplication and exponentiation are easy: the challenge is
addition. This is achieved using the (trivial) identity
\(\log(e^x+e^y)=x+\log(1+e^{y-x})\)
where, WLOG, \(y<x\).
Complex numbers are stored as a pair of brob
s: objects of class
glub
.
The package is a simple example of S4 methods.
However, it could be viewed as a cautionary tale: the
underlying R concepts are easy yet the S4 implementation is long and
difficult. I would not recommend using S4 methods for a package as
simple as this; S3 methods would have been perfectly adequate.
I would suggest that S4 methods should only be used when S3 methods
are demonstrably inadequate.