mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[poincare] When num or den of a division is Overflow, return overflow
This commit is contained in:
committed by
EmilieNumworks
parent
c12b86cdd4
commit
2fa6d4eb83
@@ -591,10 +591,10 @@ Integer Integer::multiplyByPowerOfBase(uint8_t pow) const {
|
||||
|
||||
IntegerDivision Integer::udiv(const Integer & numerator, const Integer & denominator) {
|
||||
if (denominator.isOverflow()) {
|
||||
return {.quotient = Integer(0), .remainder = Integer::Overflow(false)};
|
||||
return {.quotient = Integer::Overflow(false), .remainder = Integer::Overflow(false)};
|
||||
}
|
||||
if(numerator.isOverflow()) {
|
||||
return {.quotient = Integer::Overflow(false), .remainder = Integer(0)};
|
||||
return {.quotient = Integer::Overflow(false), .remainder = Integer::Overflow(false)};
|
||||
}
|
||||
/* Modern Computer Arithmetic, Richard P. Brent and Paul Zimmermann
|
||||
* (Algorithm 1.6) */
|
||||
|
||||
Reference in New Issue
Block a user