On Thu, May 02, 2024 at 07:22:52PM +0200, Ralf Hemmecke wrote:
> It is, of course, only a convenience, but I find it somewhat weird that
> SPAD does not allow to divide a rational number by an integer.
> The available signatures only say
>
> http://fricas.github.io/api/Fraction.html#l4672616374696f6e-2f
>
> /: (%, %) -> %
> /: (S, S) -> %
>
> but not
>
> /: (%, S) -> %
>
> Would it be a bad idea to add such an implementation to Fraction?
> Or even add a default implementationn like
>
> ((x: %) / (s: S)): % == numer(x) / (s*denom(x)
>
> to QuotientFieldCategory?
AFAICS such division is already implemented in Fraction, more
precisely Fraction inherits implementation from LocalAlgebra.
What is missing is declaration, so inherited operation is not
exported.
I do not know conseqences. I think that there is nontrival number
of cases (enough that I remember this happening) when to divide
I need something special first, like coercion or computing inverse.
I can not say how many involve fractions. OTOH there are possible
bad things, like interpter doing strange inference or Spad compiler
loosing time on useless possibilities.
One simply needs to experiment to find out.
--
Waldek Hebisch
--
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 on the web visit
https://groups.google.com/d/msgid/fricas-devel/ZjQo7h2L2D6tqsrB%40fricas.org.