Closed fjames86 closed 11 years ago
in fact, also applies to any negative sign, e.g. #{1 - 4x + 7} -> #{-6 -4x}
the above issue is now fixed. but the double sign problem remains and looks to be difficult to fix. double signs should not be allowed anyyway
could be fixed by adding a 2nd accumulator to build-monomial, so there is a separate accumulator for the total polynomial (which gets summed) and the monomial (which gets multiplied).
now fixed, so that e.g. #{-4} -> #{-4} instead of #{-3} as before, similarly #{++++} -> #{0}. However, multiple signs still aren't really correctly handled, since multiple negative signs don't work. so #{--3} -> #{-3} instead of #{3}.
parser can't deal with fractional coefficients, although they are perfectly permissible. probably should add this functionality to the parser.
could also add arbitrary expressions for exponents, e.g. #{x ^ (3*4)} -> #{x^7}
bug fixed. extensions to the parser could be added at a later date but are not essential at this time.
incorrectly parses terms with multiple signs, e.g.
{1 ++ 4x} -> #{2 + 4x}
{1 -- 4x} -> #{4x}
Something strange happening here...