Feature #269
PPMonoids: check for exponent overflow in power function
Description
A cheap safety check for exponent overflow would be simply to conduct the check in the power
functions for PPMonoids. This should detect cases where an input contains exponents which exceed the implementation's limit.
We have already decided that checking each product is too costly (except in DEBUG mode). JAA suspects that the power functions are called relatively rarely, so adding the check to them should incur no perceptible run-time cost, yet would help detect oversize input.
What do you think?
Related issues
History
#1 Updated by Anna Maria Bigatti over 11 years ago
Suggestion:
We need a function sounding like "myIsTooBigForExponent(EXP)" to be called before
owner(pp)->myPower(raw(ans), raw(pp), EXP);
#2 Updated by Anna Maria Bigatti over 11 years ago
- Target version set to CoCoALib-0.9953
#3 Updated by John Abbott about 11 years ago
- Status changed from New to In Progress
- Assignee set to John Abbott
- % Done changed from 0 to 50
I have modified the powering mem fns for PPMonoidEvImpl
and PPMonoidEvOvImpl
(the Ev
half).
I have also made a similar change to OrdvArith::base::myPower
; this covers half of PPMonoidEvOv
and all of PPMonoidOv
.
A couple of simple tests showed that the checks are working.
#4 Updated by John Abbott about 11 years ago
- Status changed from In Progress to Feedback
- % Done changed from 50 to 90
Some casual tests were passed without problem; so I have checked in everything.
Changing status to feedback.
#5 Updated by Anna Maria Bigatti about 11 years ago
All tests pass on my machine.
#6 Updated by John Abbott almost 11 years ago
- Status changed from Feedback to Closed
- % Done changed from 90 to 100
This issue has been in feedback for about 2 months; no problems have surfaced, so I'm closing the issue.