On 5/13/26 09:10, Qian Yun wrote:
Oh! AInterval supports Fraction. I never realized that.
However, as Waldek mentioned, the default implementation of
AIntervalCategory should be overridden in Interval, because applying the
up/down rounding for both inv and * might lead to a bigger interval than
necessary.
Additionally, Interval(R) does deliberately not inherit the
implementation of AInterval. For me the reason was the qinterval
definition in AInterval. As far as I understand (Waldek please correct
me, if I am wrong), that qinterval would be used in all the definitions
coming from the defaults in AIntervalCategory. If we then had Interval
inheriting the implementation of AInterval, then, (even though Interval
defines its own qinterval), the implementation of abs would be the one
from AInterval (and thus using the definition of qinterval from
AInterval, not Interval).
I simply did not think of ^: (%, Integer) -> % for AIntervalCategory.
I agree, adding it.
Ralf
There's no concrete usecase for ^ and / in Interval,
as I said, just concerns about consistency.
- Qian
On 5/13/26 2:38 PM, 'Ralf Hemmecke' via FriCAS - computer algebra system
wrote:
On 5/13/26 04:19, Qian Yun wrote:
If Interval supports negative fraction power, then it should
support negative integer power.
If Interval supports negative integer power (inverse),
then it's natural to support division.
Where do we draw the line to stop?
Usefulness.
I implemented AInteval, because we didn't have it before and I needed
interval computation for rational numbers.
I have no problem with adding ^:(%,Integer)->% (and default
implementation in AIntervalCategory) (division is already there) and
generalizing from Field to DivisionRing.
However, do you have a concrete usecase for intervals in a DivisionRing?
Ralf
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/40496498-5103-4f93-87d6-3f9756d49004%40hemmecke.org.