On 04/16/2018 03:15 PM, Waldek Hebisch wrote:
> AFAICS several patches make code more complicated, I am not
> shure if we want such changes.  In particular, while in
> Factored exponents should be nonnegative it make perfect
> mathematical sense to also have negative exponents.
> To make things more clean we could have a separete domain
> allowing negative exponents and Factored could inherit
> from this domain most of its operations.  That just a thought,
> but it seems that disallowing negative exponents in
> implementations leads to more complicated code.

Logically, Qian is right, but I often avoid NNI or PI, because then I
would have to write

  qcoerce(n::Integer - 1)@PI

just to get the types right while working in PI and knowing that n-1
will be positive.

I would support Qian, if a-b inside PI or NNI could be written in a more
natural way. (I still don't like SubDomain, since inheritance of the
function signatures is not clear.)

> Also changing recursion to loops seem to complicated code.

Since we have restricted recursion depth and I've already had problems
with deep recursion, I am in favour of loops-instead-recursion.
Maybe, at some places it would be a good idea to hint in the comments at
the recursive nature of the loop, if the recursive way looks much simpler.

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