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
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.
I am not sure about this.
At the moment,
isComplexNumber
means "is this an instance of PMComplexNumber?" andisRealNumber
means "is this an instance on Number which is not an instance of PMComplexNumber?"Therefore,
Even though
In mathematics though, a set of real numbers is fully included into the set of complex numbers:
Every real number is complex.
Perhaps, we should have something like this:
The result would be:
Or maybe we should even have this:
What do you think?
The text was updated successfully, but these errors were encountered: