-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NumberSystem must support Number types outside the JDK #229
Comments
Just to clarify: Any implementation of our |
... this might be inconvenient for some use-cases, but still I'd rather have a reference implementation that does the arithmetic right (and fails early), than using a fallback which might involve precision loss, only to play nice with other libraries. However, we could provide a second |
Can they do that without further extending e.g. |
Yes, at least that's the intent. |
It seems to do this only via a static member variable in Calculus, I probably would move this to the Indriya SPI similar to DimensionalModel Most people won't have to replace the |
Fine with me! |
DefaultNumberSystem currently throws an IllegalArgumentException outside a small selection of Number subtypes, primarily those inside the JDK.
That is not a reasonable behavior, because there are other Number types defined by libraries like Apache Commons Numbers, GNU Math although that even defines
Quantity
andUnit
in a rather weird way (Unit
extendsQuantity
and both extendNumeric
which is aNumber
), but other numeric types likeRealNum
often go beyond what we define here, so it should not be prevented to use another kind ofNumber
.The text was updated successfully, but these errors were encountered: