FriCAS Integer implements exquo via

INTEXQUO(x, y)$Lisp

https://github.com/fricas/fricas/blob/master/src/algebra/integer.spad#L143

I have several places where I know from context that the division will
not fail (I divide out a gcd). Wouldn't it make sense to expose INTEXQUO
in Integer as

exactQuotient(x: %, y: %): % == INTEXQUO(x, y)$Lisp pretend %

with the docstring saying

++ exactQuotient(x, y) returns an integer z such that x = y * z
++ if such a z exists. The result is undefined if such a z does
++ not exist.

Clearly, that is a partial function. But I think it makes sense to also
expose useful partial functions without putting the result in
Union(Integer, "failed").
Isn't it a waste to put an integer into a union, if the first thing a
user does is to simply take out the integer from the union structure?

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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to