On Thursday, February 6, 2003, 1:31:39 AM, Daniel wrote:

> That's really cool!

We seem to have lost some context.

> Do you know how it does it?  Does the 'require' set a variable or 
> something?  I ask because I want to make a Math::Polynomial class that can 
> be used both for real and complex polynomials.

You can look at the complex.rb source - it's easy to understand.

Spoiler: complex.rb redefines Math.sqrt.

As for your Polynomial class, just make it work for reals, then
require 'complex.rb', and see if it works for complex numbers.  It
probably will.  If it doesn't, you'll probably be able to spot a few
extra methods that are needed, or something.

Gavin