Bug #108
Unhandled division by zero in FFp
Status:
Closed
Priority:
Normal
Assignee:
Category:
Parser/Interpreter
Target version:
Description
Here's a sample case
Use ZZ/(7)[x]; f:=2+x-x; f/7; --> ERROR: Division by zero or by a zero-divisor (1/7)*f; --> NASTY ERROR!!
History
#1 Updated by Anna Maria Bigatti about 12 years ago
- Category set to Parser/Interpreter
- Status changed from New to Resolved
- Assignee set to Anna Maria Bigatti
- Target version set to CoCoA-5.0.2
- % Done changed from 0 to 90
- Estimated time set to 2.00 h
Fixed, but the error is indicated at the operator
/**/ ERROR: Cannot embed rational number into ring (1/7)*f; ^
The function "TypeValue::convert" in Interpreter.C throws when tying to covert 1/7 into a RingElem in RingOf(f).
It does not have enough information to indicate where the error is.
So I added 2 "try.. catch" in "RuntimeEnvironment::binaryOperatorDispatch" around "convert" for left-to-right-type and right-to-left-type.
These 2 are the only calls to "Type::convert".
#2 Updated by John Abbott about 12 years ago
- Status changed from Resolved to Closed
- % Done changed from 90 to 100