regina::NNativeInteger< bytes > Class Template Reference
Mathematical Support

A wrapper class for a native, fixed-precision integer type of the given size. More...

`#include <maths/ninteger.h>`

## Public Types

typedef IntOfSize< bytes >::type | Native
| The native data type used to store this integer. More...

## Public Member Functions

| NNativeInteger ()
| Initialises this integer to zero. More...
| NNativeInteger (Native value)
| Initialises this integer to the given value. More...
| NNativeInteger (const NNativeInteger< bytes > &value)
| Initialises this integer to the given value. More...
template<bool supportInfinity>
| NNativeInteger (const NIntegerBase< supportInfinity > &value)
| Initialises this integer to the given value. More...
bool | isZero () const
| Returns whether or not this integer is zero. More...
int | sign () const
| Returns the sign of this integer. More...
Native | nativeValue () const
| Returns the value of this integer in its native type. More...
NNativeInteger & | operator= (const NNativeInteger &value)
| Sets this integer to the given value. More...
NNativeInteger & | operator= (Native value)
| Sets this integer to the given value. More...
void | swap (NNativeInteger &other)
| Swaps the values of this and the given integer. More...
bool | operator== (const NNativeInteger &rhs) const
| Determines if this is equal to the given integer. More...
bool | operator== (Native rhs) const
| Determines if this is equal to the given integer. More...
bool | operator!= (const NNativeInteger &rhs) const
| Determines if this is not equal to the given integer. More...
bool | operator!= (Native rhs) const
| Determines if this is not equal to the given integer. More...
bool | operator< (const NNativeInteger &rhs) const
| Determines if this is less than the given integer. More...
bool | operator< (Native rhs) const
| Determines if this is less than the given integer. More...
bool | operator> (const NNativeInteger &rhs) const
| Determines if this is greater than the given integer. More...
bool | operator> (Native rhs) const
| Determines if this is greater than the given integer. More...
bool | operator<= (const NNativeInteger &rhs) const
| Determines if this is less than or equal to the given integer. More...
bool | operator<= (Native rhs) const
| Determines if this is less than or equal to the given integer. More...
bool | operator>= (const NNativeInteger &rhs) const
| Determines if this is greater than or equal to the given integer. More...
bool | operator>= (Native rhs) const
| Determines if this is greater than or equal to the given integer. More...
NNativeInteger & | operator++ ()
| The preincrement operator. More...
NNativeInteger | operator++ (int)
| The postincrement operator. More...
NNativeInteger & | operator-- ()
| The predecrement operator. More...
NNativeInteger | operator-- (int)
| The postdecrement operator. More...
NNativeInteger | operator+ (const NNativeInteger &other) const
| Adds this to the given integer and returns the result. More...
NNativeInteger | operator+ (Native other) const
| Adds this to the given integer and returns the result. More...
NNativeInteger | operator- (const NNativeInteger &other) const
| Subtracts the given integer from this and returns the result. More...
NNativeInteger | operator- (Native other) const
| Subtracts the given integer from this and returns the result. More...
NNativeInteger | operator* (const NNativeInteger &other) const
| Multiplies this by the given integer and returns the result. More...
NNativeInteger | operator* (Native other) const
| Multiplies this by the given integer and returns the result. More...
NNativeInteger | operator/ (const NNativeInteger &other) const
| Divides this by the given integer and returns the result. More...
NNativeInteger | operator/ (Native other) const
| Divides this by the given integer and returns the result. More...
NNativeInteger | divExact (const NNativeInteger &other) const
| Divides this by the given integer and returns the result. More...
NNativeInteger | divExact (Native other) const
| Divides this by the given integer and returns the result. More...
NNativeInteger | operator% (const NNativeInteger &other) const
| Determines the remainder when this integer is divided by the given integer. More...
NNativeInteger | operator% (Native other) const
| Determines the remainder when this integer is divided by the given integer. More...
NNativeInteger< bytes > | divisionAlg (const NNativeInteger< bytes > &divisor, NNativeInteger< bytes > &remainder) const
| Uses the division algorithm to obtain a quotient and remainder when dividing by the given integer. More...
NNativeInteger | operator- () const
| Determines the negative of this integer. More...
NNativeInteger & | operator+= (const NNativeInteger &other)
| Adds the given integer to this. More...
NNativeInteger & | operator+= (Native other)
| Adds the given integer to this. More...
NNativeInteger & | operator-= (const NNativeInteger &other)
| Subtracts the given integer from this. More...
NNativeInteger & | operator-= (Native other)
| Subtracts the given integer from this. More...
NNativeInteger & | operator*= (const NNativeInteger &other)
| Multiplies the given integer by this. More...
NNativeInteger & | operator*= (Native other)
| Multiplies the given integer by this. More...
NNativeInteger & | operator/= (const NNativeInteger &other)
| Divides this by the given integer. More...
NNativeInteger & | operator/= (Native other)
| Divides this by the given integer. More...
NNativeInteger & | divByExact (const NNativeInteger &other)
| Divides this by the given integer. More...
NNativeInteger & | divByExact (Native other)
| Divides this by the given integer. More...
NNativeInteger & | operator%= (const NNativeInteger &other)
| Reduces this integer modulo the given integer. More...
NNativeInteger & | operator%= (Native other)
| Reduces this integer modulo the given integer. More...
void | negate ()
| Negates this integer. More...
void | gcdWith (const NNativeInteger &other)
| Sets this integer to be the greatest common divisor of this and the given integer. More...
NNativeInteger | gcd (const NNativeInteger &other) const
| Determines the greatest common divisor of this and the given integer. More...

## Friends

template<int bytes_>
std::ostream & | operator<< (std::ostream &out, const NNativeInteger< bytes_ > &large)

## Detailed Description

### template<int bytes>
class regina::NNativeInteger< bytes >

A wrapper class for a native, fixed-precision integer type of the given size.

This class behaves just like native integer arithmetic, where the underlying integer type is signed and stores the given number of bytes. There is no overflow testing, and it is up to the user to ensure that overflows do not occur. On the other hand, this class is almost as fast as native integer arithmetic (i.e., there is very little overhead).

The reason for using this class, instead of working directly in a native integer type, is that this class offers an interface that is compatible with NInteger. Only some of the NInteger member functions are offered here; however, those that are offered behave just like their NInteger counterparts (with the single exception that all arithmetic in NNativeInteger is subject to overflow). Developers can therefore switch between integer types easily with minimal changes to their code, or support both NInteger and NNativeInteger types as template arguments.

Precondition
  The system must support integers of the given size; in particular, there must be an appropriate specialisation IntOfSize<bytes>.

Python:
  Not present.

## Member Typedef Documentation

template<int bytes>

typedef IntOfSize<bytes>::type regina::NNativeInteger< bytes >::Native

The native data type used to store this integer.

## Constructor & Destructor Documentation

template<int bytes>

regina::NNativeInteger< bytes >::NNativeInteger | ( |  | ) |

inline

Initialises this integer to zero.

template<int bytes>

regina::NNativeInteger< bytes >::NNativeInteger | ( | Native | value | ) |

inline

Initialises this integer to the given value.

Parameters

  value | the new value of this integer.

template<int bytes>

regina::NNativeInteger< bytes >::NNativeInteger | ( | const NNativeInteger< bytes > & | value | ) |

inline

Initialises this integer to the given value.

Parameters

  value | the new value of this integer.

template<int bytes>
template<bool supportInfinity>

regina::NNativeInteger< bytes >::NNativeInteger | ( | const NIntegerBase< supportInfinity > & | value | ) |

inline explicit

Initialises this integer to the given value.

This constructor is marked as explicit in the hope of avoiding accidental (and unintentional) mixing of integer classes.

It is the programmer's reponsibility to ensure that the given value fits within the required range. If the given value is too large or small to fit into this native type, then this new NNativeInteger will have an undefined initial value.

Precondition
  If bytes is larger than sizeof(long), then bytes is a strict multiple of sizeof(long). For instance, if longs are 8 bytes then you can use this routine with bytes=16 but not bytes=12. This restriction is enforced through a compile-time assertion, but may be lifted in future versions of Regina.
  The given integer is not infinity.

Python:
  Not present.

Parameters

  value | the new value of this integer.

## Member Function Documentation

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::divByExact | ( | const NNativeInteger< bytes > & | other | ) |

inline

Divides this by the given integer.

For native integers, this routine is identical to operator /=.

Precondition
  other is not zero.

Parameters

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::divByExact | ( | Native | other | ) |

inline

Divides this by the given integer.

For native integers, this routine is identical to operator /=.

Precondition
  other is not zero.

Parameters

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::divExact | ( | const NNativeInteger< bytes > & | other | ) | const

inline

Divides this by the given integer and returns the result.

For native integers, this is identical to operator /.

Precondition
  other is not zero.

Parameters

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::divExact | ( | Native | other | ) | const

inline

Divides this by the given integer and returns the result.

For native integers, this is identical to operator /.

Precondition
  other is not zero.

Parameters

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::divisionAlg | ( | const NNativeInteger< bytes > & | divisor,
|  | NNativeInteger< bytes > & | remainder
| ) |  | const

inline

Uses the division algorithm to obtain a quotient and remainder when dividing by the given integer.

Suppose this integer is n and we pass the divisor d. The division algorithm describes the result of dividing n by d; in particular, it expresses `n = qd + r`, where q is the quotient and r is the remainder.

The division algorithm is precise about which values of q and r are chosen; in particular it chooses the unique r in the range `0 <= r < |d|`.

Note that this differs from other division routines in this class, in that it always rounds to give a non-negative remainder. Thus NNativeInteger(-7).divisionAlg(3) gives quotient -3 and remainder 2, whereas (-7)/3 gives quotient -2 and (-7)%3 gives remainder -1.

The two results are passed back to the caller as follows: The quotient q is passed back as the return value of the function, and the remainder r is stored in the reference argument r.

In the special case where the given divisor is 0 (not allowed by the usual division algorithm), this routine selects quotient 0 and remainder n.

Parameters

  divisor | the divisor d.
  remainder | used to store the remainder r when the functon returns. The initial value of this argument is ignored.

Returns
  the quotient q.

Author
  Ryan Budney & B.B.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::gcd | ( | const NNativeInteger< bytes > & | other | ) | const

inline

Determines the greatest common divisor of this and the given integer.

This integer is not changed.

The result is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

Parameters

  other | the integer whose greatest common divisor with this will be found.

Returns
  the greatest common divisor of this and the given integer.

template<int bytes>

void regina::NNativeInteger< bytes >::gcdWith | ( | const NNativeInteger< bytes > & | other | ) |

Sets this integer to be the greatest common divisor of this and the given integer.

The result is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

Parameters

  other | the integer whose greatest common divisor with this will be found.

Now everything is non-negative. The following code is based on Stein's binary GCD algorithm.

template<int bytes>

bool regina::NNativeInteger< bytes >::isZero | ( |  | ) | const

inline

Returns whether or not this integer is zero.

Returns
  `true` if and only if this integer is zero.

template<int bytes>

NNativeInteger< bytes >::Native regina::NNativeInteger< bytes >::nativeValue | ( |  | ) | const

inline

Returns the value of this integer in its native type.

Returns
  the value of this integer.

template<int bytes>

void regina::NNativeInteger< bytes >::negate | ( |  | ) |

inline

Negates this integer.

This integer is changed to reflect the result.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator!= | ( | const NNativeInteger< bytes > & | rhs | ) | const

inline

Determines if this is not equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are not equal.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator!= | ( | Native | rhs | ) | const

inline

Determines if this is not equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are not equal.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator% | ( | const NNativeInteger< bytes > & | other | ) | const

inline

Determines the remainder when this integer is divided by the given integer.

If non-zero, the result will have the same sign as this integer. This integer is not changed.

For a division routine that always returns a non-negative remainder, see divisionAlg().

Precondition
  other is not zero.

Warning
  As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.

Parameters

  other | the integer to divide this by.

Returns
  the remainder this modulo other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator% | ( | Native | other | ) | const

inline

Determines the remainder when this integer is divided by the given integer.

If non-zero, the result will have the same sign as this integer. This integer is not changed.

For a division routine that always returns a non-negative remainder, see divisionAlg().

Precondition
  other is not zero.

Warning
  As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.

Parameters

  other | the integer to divide this by.

Returns
  the remainder this modulo other.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator%= | ( | const NNativeInteger< bytes > & | other | ) |

inline

Reduces this integer modulo the given integer.

If non-zero, the result will have the same sign as the original value of this integer. This integer is changed to reflect the result.

For a mod routine that always returns a non-negative remainder, see divisionAlg().

Precondition
  other is not zero.

Warning
  As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.

Parameters

  other | the integer modulo which this integer will be reduced.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator%= | ( | Native | other | ) |

inline

Reduces this integer modulo the given integer.

If non-zero, the result will have the same sign as the original value of this integer. This integer is changed to reflect the result.

For a mod routine that always returns a non-negative remainder, see divisionAlg().

Precondition
  other is not zero.

Warning
  As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.

Parameters

  other | the integer modulo which this integer will be reduced.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator* | ( | const NNativeInteger< bytes > & | other | ) | const

inline

Multiplies this by the given integer and returns the result.

This integer is not changed.

Parameters

  other | the integer to multiply by this integer.

Returns
  the product this times other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator* | ( | Native | other | ) | const

inline

Multiplies this by the given integer and returns the result.

This integer is not changed.

Parameters

  other | the integer to multiply by this integer.

Returns
  the product this times other.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator*= | ( | const NNativeInteger< bytes > & | other | ) |

inline

Multiplies the given integer by this.

This integer is changed to reflect the result.

Parameters

  other | the integer to multiply with this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator*= | ( | Native | other | ) |

inline

Multiplies the given integer by this.

This integer is changed to reflect the result.

Parameters

  other | the integer to multiply with this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator+ | ( | const NNativeInteger< bytes > & | other | ) | const

inline

Adds this to the given integer and returns the result.

This integer is not changed.

Parameters

  other | the integer to add to this integer.

Returns
  the sum this plus other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator+ | ( | Native | other | ) | const

inline

Adds this to the given integer and returns the result.

This integer is not changed.

Parameters

  other | the integer to add to this integer.

Returns
  the sum this plus other.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator++ | ( |  | ) |

inline

The preincrement operator.

This operator increments this integer by one, and returns a reference to the integer after the increment.

Python:
  Not available.

Returns
  a reference to this integer after the increment.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator++ | ( | int |  | ) |

inline

The postincrement operator.

This operator increments this integer by one, and returns a copy of the integer before the increment.

Python:
  Not available.

Returns
  a copy of this integer before the increment took place.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator+= | ( | const NNativeInteger< bytes > & | other | ) |

inline

Adds the given integer to this.

This integer is changed to reflect the result.

Parameters

  other | the integer to add to this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator+= | ( | Native | other | ) |

inline

Adds the given integer to this.

This integer is changed to reflect the result.

Parameters

  other | the integer to add to this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator- | ( | const NNativeInteger< bytes > & | other | ) | const

inline

Subtracts the given integer from this and returns the result.

This integer is not changed.

Parameters

  other | the integer to subtract from this integer.

Returns
  the difference this minus other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator- | ( | Native | other | ) | const

inline

Subtracts the given integer from this and returns the result.

This integer is not changed.

Parameters

  other | the integer to subtract from this integer.

Returns
  the difference this minus other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator- | ( |  | ) | const

inline

Determines the negative of this integer.

This integer is not changed.

Returns
  the negative of this integer.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator-- | ( |  | ) |

inline

The predecrement operator.

This operator decrements this integer by one, and returns a reference to the integer after the decrement.

Python:
  Not available.

Returns
  a reference to this integer after the decrement.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator-- | ( | int |  | ) |

inline

The postdecrement operator.

This operator decrements this integer by one, and returns a copy of the integer before the decrement.

Python:
  Not available.

Returns
  a copy of this integer before the decrement took place.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator-= | ( | const NNativeInteger< bytes > & | other | ) |

inline

Subtracts the given integer from this.

This integer is changed to reflect the result.

Parameters

  other | the integer to subtract from this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator-= | ( | Native | other | ) |

inline

Subtracts the given integer from this.

This integer is changed to reflect the result.

Parameters

  other | the integer to subtract from this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator/ | ( | const NNativeInteger< bytes > & | other | ) | const

inline

Divides this by the given integer and returns the result.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is not changed.

For a division routine that always rounds down, see divisionAlg().

Precondition
  other must be non-zero.

Warning
  As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.

Parameters

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

template<int bytes>

NNativeInteger< bytes > regina::NNativeInteger< bytes >::operator/ | ( | Native | other | ) | const

inline

Divides this by the given integer and returns the result.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is not changed.

For a division routine that always rounds down, see divisionAlg().

Precondition
  other must be non-zero.

Warning
  As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.

Parameters

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator/= | ( | const NNativeInteger< bytes > & | other | ) |

inline

Divides this by the given integer.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is changed to reflect the result.

For a division routine that always rounds down, see divisionAlg().

Precondition
  other must be non-zero.

Warning
  As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.

Parameters

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator/= | ( | Native | other | ) |

inline

Divides this by the given integer.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is changed to reflect the result.

For a division routine that always rounds down, see divisionAlg().

Precondition
  other must be non-zero.

Warning
  As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.

Parameters

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator< | ( | const NNativeInteger< bytes > & | rhs | ) | const

inline

Determines if this is less than the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is less than the given integer.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator< | ( | Native | rhs | ) | const

inline

Determines if this is less than the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is less than the given integer.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator<= | ( | const NNativeInteger< bytes > & | rhs | ) | const

inline

Determines if this is less than or equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is less than or equal to the given integer.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator<= | ( | Native | rhs | ) | const

inline

Determines if this is less than or equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is less than or equal to the given integer.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator= | ( | const NNativeInteger< bytes > & | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

NNativeInteger< bytes > & regina::NNativeInteger< bytes >::operator= | ( | Native | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator== | ( | const NNativeInteger< bytes > & | rhs | ) | const

inline

Determines if this is equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are equal.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator== | ( | Native | rhs | ) | const

inline

Determines if this is equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are equal.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator> | ( | const NNativeInteger< bytes > & | rhs | ) | const

inline

Determines if this is greater than the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is greater than the given integer.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator> | ( | Native | rhs | ) | const

inline

Determines if this is greater than the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is greater than the given integer.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator>= | ( | const NNativeInteger< bytes > & | rhs | ) | const

inline

Determines if this is greater than or equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is greater than or equal to the given integer.

template<int bytes>

bool regina::NNativeInteger< bytes >::operator>= | ( | Native | rhs | ) | const

inline

Determines if this is greater than or equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this is greater than or equal to the given integer.

template<int bytes>

int regina::NNativeInteger< bytes >::sign | ( |  | ) | const

inline

Returns the sign of this integer.

Returns
  +1, -1 or 0 according to whether this integer is positive, negative or zero.

template<int bytes>

void regina::NNativeInteger< bytes >::swap | ( | NNativeInteger< bytes > & | other | ) |

inline

Swaps the values of this and the given integer.

Parameters

  other | the integer whose value will be swapped with this.

The documentation for this class was generated from the following file:

- maths/ninteger.h

Copyright © 1999-2013, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).