You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Any number isComplexNumber should answer true #194
At the moment, isComplexNumber means "is this an instance of PMComplexNumber?" and isRealNumber means "is this an instance on Number which is not an instance of PMComplexNumber?"
Therefore,
As discussed in #193 the implication of that would be:
if any Number answer true to isComplexNumber, then it should also behave asComplexNumber.
For example, one implication would be
[ -2 sqrt = -2 asComplexNumber sqrt ] assert.
In other words, usual mathematical functions should be extended to complex extension, instead of raising an Error...
That's a change of previous contracts for every other client of sqrt & co.
An alternative would be to distinguish the complex extension: create complex-specific math functions (i.e. complexSqrt, complexArcCos, complexLn, ...).
Yet another alternative would be to make the behavior contextual. How to implement, and how to specify the context is yet to be defined.
Activity
nicolas-cellier-aka-nice commentedon Feb 23, 2021
As discussed in #193 the implication of that would be:
if any Number answer true to isComplexNumber, then it should also behave asComplexNumber.
For example, one implication would be
In other words, usual mathematical functions should be extended to complex extension, instead of raising an Error...
That's a change of previous contracts for every other client of sqrt & co.
An alternative would be to distinguish the complex extension: create complex-specific math functions (i.e. complexSqrt, complexArcCos, complexLn, ...).
Yet another alternative would be to make the behavior contextual. How to implement, and how to specify the context is yet to be defined.