Error, (in ...) numeric exception: division by zero
|
Description
|
|
In Maple, dividing by zero produces a division by zero error. However, sometimes the division by zero is not apparent.
|
|
Examples
|
|
Example 1
>
|
|
>
|
|
>
|
|
Solution: Replace the NumericEventHandler for division by zero.
>
|
|
| (2.1) |
>
|
|
| (2.2) |
>
|
|
| (2.3) |
>
|
|
Example 2
>
|
|
| (2.4) |
>
|
|
| (2.5) |
>
|
|
The weakness is in int, which does not identify as equal to 0. Simplifying the expanded output from int then leads to division by zero. A stronger zero-testing routine is required earlier in the process. However, using the strongest possible zero-testing routine by default is inefficient.
Solution 1: For a single expression, simplify before taking the integral.
>
|
|
>
|
|
| (2.6) |
>
|
|
| (2.7) |
Solution 2: For numerous expressions, control zero-testing using Normalizer.
>
|
|
>
|
|
| (2.8) |
>
|
|
| (2.9) |
>
|
|
| (2.10) |
|
|
Download Help Document
Was this information helpful?