...
Math errors can be prevented by carefully bounds-checking the arguments before calling functions. In particular, the following domain errors functions should be prevented by prior bounds-checkingbounds checked as follows:
Function | Bounds-checking |
---|---|
-1 <= x && x <= 1 | |
x != 0 || y != 0 | |
x >= 0 | |
x != 0 || y > 0 | |
x >= 0 |
...