Skip to content

Migration ​

The full list of changes is in the changelog. This page lists what usually breaks first when moving from 0.2.x to 0.3.

Method calls that changed ​

BeforeAfter
fraction.fracfraction.asFrac (as*** getters select a form)
polynom.isMultiVariablepolynom.hasCrossTerm() (predicates are methods)
fraction.isRational() on integersnow true for any exact rational, integers included; hasFractionalPart() is the old one
equation.isolate() returning falseequation.canIsolate() first, then isolate(), which throws MathError
polynom.inverse() === undefinedthrows MathError
new Fraction()now equals 0

Behaviors that changed silently ​

Some changes are not reported by the TypeScript compiler, and untyped JavaScript will not report them either:

  • polynom.monoms returns copies. Modify a polynomial with its methods or by assigning polynom.monoms = [...].
  • Invalid arguments now throw InvalidArgumentError in the random generators, before any draw.
  • Random.equation draws fractional solutions in [-5, 5] by default. Use solution: {range: 10} for a wider interval.
  • Random.item on an empty list throws instead of returning null.

Typed errors ​

Plain Error instances are replaced by typed errors. Replace tests on e.message by instanceof checks.

Released under the MIT License.