Last in this series: behavior of irem()

Roberto Bagnara bagnara at cs.unipr.it
Tue Oct 1 12:59:46 CEST 2002


The function

  numeric irem(const numeric &a, const numeric &b)

prints "Division by zero." and exits when b is zero.
As in all the other cases reported, this makes it
more difficult to write robust software.  Of course,
we can check b before calling irem() (and we are doing it)
but this impedes performance for no reason, since the
test on b must be re-done anyway in order to decide whether
to print the error message and exit.
All the best

       Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it





More information about the GiNaC-list mailing list