feat(return types): Add more return types for complex functions

These changes greatly increased the need for precision in generating
  implementations for signatures of operations whenever possible. So this
  commit also includes a refactor that basically caches all of the
  conversions of Pocomath implementations to typed-function implementatios so
  that they are more often externally available (i.e., not disrupted so much
  after invalidation).
This commit is contained in:
Glen Whitney 2022-08-26 23:54:32 -04:00
parent bc434c7163
commit a2f76a55b8
13 changed files with 273 additions and 98 deletions

View file

@ -83,6 +83,7 @@ describe('complex', () => {
assert.deepStrictEqual(
math.multiply(q0, math.quaternion(2, 1, 0.1, 0.1)),
math.quaternion(1.9, 1.1, 2.1, -0.9))
math.absquare(math.complex(1.25, 2.5)) //HACK: need absquare(Complex<number>)
assert.strictEqual(math.abs(q0), Math.sqrt(2))
assert.strictEqual(math.abs(q1), Math.sqrt(33)/4)
})