Ralf Hemmecke wrote:
> 
> I don't like this. If you specify that p and q have to be non-zero, then
> checking in code is just a safety check that supports either users that
> do not want to read the specification or you want to add a security
> meassure for cases when sylvesterMatrix is used as a sub-routine and is
> called with zero arguments. That's, of course a bug, but not a bug in
> sylvesterMatrix, but in the calling program.

I am surprised by your critique.  Bugs happen and normal
policy is to have checks like this.  We may skip checks
if restrictions are due to called operations and called
operations check their arguments.

> I'm not a fan of (randomly) checking for conditions of arguments that
> (according to the specification) should never be given. Admittedly your
> test is not time consuming, but is by specification unnecessary.
> 
> BTW, why "p=0" instead of "zero?(p)".

Well, I find 'p = 0' clearer and more readable than 'zero?(p)'.
Smilarly for 'p = 1' versus 'one?(p)'.  OTOH 'zero?(p)':
- is usable as functional argument (no need for extra anonymous
  function)
- may be more efficient

So there are reasons to have 'zero?' and 'one?' but naturaly
their use should be limited.  Concerning efficiency, using
'not(a = b)' frequently gives speed gain compared to 'a ~= b'.
Gains from 'zero?' and 'one?' are relatively smaller.

-- 
                              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 post to this group, send email to [email protected].
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