Regarding qinterval, documentation in AIntervalCategory says
++ qinterval(inf,sup) creates a new interval without checking the
++ ordering on the elements.
Implementation in Interval says
qinterval(i : R, s : R) : % ==
[roundDown i, roundUp s]
I think in Interval we should have "qinterval(i, s) = [i, s]",
and have a local function that uses "[roundDown i, roundUp s]".
And choose to use one or the other wisely depending on the situation.
- Qian
On 5/13/26 3:44 PM, 'Ralf Hemmecke' via FriCAS - computer algebra system
wrote:
> 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/6c7a954c-d9f0-4871-876b-a55ac4f06ffa%40gmail.com.