diff options
Diffstat (limited to 'bigint.h')
-rw-r--r-- | bigint.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -26,7 +26,7 @@ private: void normalise(); void checkconsistent(); - std::pair<Bigint,Bigint> divmod(const Bigint&,int depth,int maxdepth) const; + std::pair<Bigint,Bigint> divmod(const Bigint&,int depth,int maxdepth) const; //ignores all signs public: Bigint(); @@ -63,7 +63,11 @@ public: Bigint operator*(slongdigit_t) const; Bigint operator<<(int) const; Bigint operator>>(int) const; - std::pair<Bigint,Bigint> divmod(const Bigint&) const; //rounds towards zero; returns {quotient,remainder} + + //Uses *mathematical* division-with-remainder. + //If we look at {q,r} = x.divmod(y), then x = q*y + r, and 0<=r<|q|. This is *not* compatible with many other + //programming languages (and, for that matter, the C++ built-in behaviour). + std::pair<Bigint,Bigint> divmod(const Bigint&) const; bool operator==(const Bigint&) const; bool operator!=(const Bigint&) const; |