vtjnash/Polynomial.jl — pull request #20 by jcrist (2014-02-24 03:16:47+00:00)
Title: Added support for alternative variables

- Added support for optional variable parameter in constructor.
- Added string function to get string representation without 'Poly(...)' appended.
- Improved printing function, now it:
- formats coefficients up to 4 decimal places (i.e. 1.123456 -> 1.1234, and 1.00005 -> 1)
- removes unnecessary powers (i.e. x^1 is just x)
- removes unnecessary coefficients (i.e. 1x is just x)
- All operations involving two polynomials now must have the same 'var' attribute (error is thrown otherwise)
- Added tests for new functionality, and updated the README.

I also fixed a small bug preventing complex polynomials from being created. There's no default comparison between a complex and a real (complex < real will error). Changed line 22 to fix that. Poly([1 + im, 1 - im]) now is valid.

Let me know what you think.