Update documentation
parent
195cd6e7c8
commit
60e7bf3081
30
integer.h
30
integer.h
|
|
@ -306,13 +306,16 @@ public:
|
||||||
signed long ConvertToLong() const;
|
signed long ConvertToLong() const;
|
||||||
|
|
||||||
/// \brief Determines the number of bits required to represent the Integer
|
/// \brief Determines the number of bits required to represent the Integer
|
||||||
/// \returns number of significant bits = floor(log2(abs(*this))) + 1
|
/// \returns number of significant bits
|
||||||
|
/// \details BitCount is calculated as <tt>floor(log2(abs(*this))) + 1</tt>.
|
||||||
unsigned int BitCount() const;
|
unsigned int BitCount() const;
|
||||||
/// \brief Determines the number of bytes required to represent the Integer
|
/// \brief Determines the number of bytes required to represent the Integer
|
||||||
/// \returns number of significant bytes = ceiling(BitCount()/8)
|
/// \returns number of significant bytes
|
||||||
|
/// \details ByteCount is calculated as <tt>ceiling(BitCount()/8)</tt>.
|
||||||
unsigned int ByteCount() const;
|
unsigned int ByteCount() const;
|
||||||
/// \brief Determines the number of words required to represent the Integer
|
/// \brief Determines the number of words required to represent the Integer
|
||||||
/// \returns number of significant words = ceiling(ByteCount()/sizeof(word))
|
/// \returns number of significant words
|
||||||
|
/// \details WordCount is calculated as <tt>ceiling(ByteCount()/sizeof(word))</tt>.
|
||||||
unsigned int WordCount() const;
|
unsigned int WordCount() const;
|
||||||
|
|
||||||
/// \brief Provides the i-th bit of the Integer
|
/// \brief Provides the i-th bit of the Integer
|
||||||
|
|
@ -354,29 +357,48 @@ public:
|
||||||
/// \name MANIPULATORS
|
/// \name MANIPULATORS
|
||||||
//@{
|
//@{
|
||||||
/// \brief Assignment
|
/// \brief Assignment
|
||||||
|
/// \param t the other Integer
|
||||||
|
/// \returns the result of assignment
|
||||||
Integer& operator=(const Integer& t);
|
Integer& operator=(const Integer& t);
|
||||||
|
|
||||||
/// \brief Addition Assignment
|
/// \brief Addition Assignment
|
||||||
|
/// \param t the other Integer
|
||||||
|
/// \returns the result of <tt>*this + t</tt>
|
||||||
Integer& operator+=(const Integer& t);
|
Integer& operator+=(const Integer& t);
|
||||||
/// \brief Subtraction Assignment
|
/// \brief Subtraction Assignment
|
||||||
|
/// \param t the other Integer
|
||||||
|
/// \returns the result of <tt>*this - t</tt>
|
||||||
Integer& operator-=(const Integer& t);
|
Integer& operator-=(const Integer& t);
|
||||||
/// \brief Multiplication Assignment
|
/// \brief Multiplication Assignment
|
||||||
|
/// \param t the other Integer
|
||||||
|
/// \returns the result of <tt>*this * t</tt>
|
||||||
/// \sa a_times_b_mod_c() and a_exp_b_mod_c()
|
/// \sa a_times_b_mod_c() and a_exp_b_mod_c()
|
||||||
Integer& operator*=(const Integer& t) {return *this = Times(t);}
|
Integer& operator*=(const Integer& t) {return *this = Times(t);}
|
||||||
/// \brief Division Assignment
|
/// \brief Division Assignment
|
||||||
|
/// \param t the other Integer
|
||||||
|
/// \returns the result of <tt>*this / t</tt>
|
||||||
Integer& operator/=(const Integer& t) {return *this = DividedBy(t);}
|
Integer& operator/=(const Integer& t) {return *this = DividedBy(t);}
|
||||||
/// \brief Remainder Assignment
|
/// \brief Remainder Assignment
|
||||||
|
/// \param t the other Integer
|
||||||
|
/// \returns the result of <tt>*this % t</tt>
|
||||||
/// \sa a_times_b_mod_c() and a_exp_b_mod_c()
|
/// \sa a_times_b_mod_c() and a_exp_b_mod_c()
|
||||||
Integer& operator%=(const Integer& t) {return *this = Modulo(t);}
|
Integer& operator%=(const Integer& t) {return *this = Modulo(t);}
|
||||||
/// \brief Division Assignment
|
/// \brief Division Assignment
|
||||||
|
/// \param t the other word
|
||||||
|
/// \returns the result of <tt>*this / t</tt>
|
||||||
Integer& operator/=(word t) {return *this = DividedBy(t);}
|
Integer& operator/=(word t) {return *this = DividedBy(t);}
|
||||||
/// \brief Remainder Assignment
|
/// \brief Remainder Assignment
|
||||||
|
/// \param t the other word
|
||||||
|
/// \returns the result of <tt>*this % t</tt>
|
||||||
/// \sa a_times_b_mod_c() and a_exp_b_mod_c()
|
/// \sa a_times_b_mod_c() and a_exp_b_mod_c()
|
||||||
Integer& operator%=(word t) {return *this = Integer(POSITIVE, 0, Modulo(t));}
|
Integer& operator%=(word t) {return *this = Integer(POSITIVE, 0, Modulo(t));}
|
||||||
|
|
||||||
/// \brief Left-shift Assignment
|
/// \brief Left-shift Assignment
|
||||||
|
/// \param n number of bits to shift
|
||||||
|
/// \returns reference to this Integer
|
||||||
Integer& operator<<=(size_t n);
|
Integer& operator<<=(size_t n);
|
||||||
/// \brief Right-shift Assignment
|
/// \brief Right-shift Assignment
|
||||||
|
/// \param n number of bits to shift
|
||||||
|
/// \returns reference to this Integer
|
||||||
Integer& operator>>=(size_t n);
|
Integer& operator>>=(size_t n);
|
||||||
|
|
||||||
/// \brief Bitwise AND Assignment
|
/// \brief Bitwise AND Assignment
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue