Loading...
Searching...
No Matches
Numbers
Common

Class implementing different number representations and helper functions. More...

Collaboration diagram for Numbers:

## Topics

| FloatCmp

## Classes

class | Dune::bigunsignedint< k >
| Portable very large unsigned integers. More...
struct | Dune::IsNumber< T >
| Whether this type acts as a scalar in the context of (hierarchically blocked) containers. More...
struct | Dune::IsNumber< bigunsignedint< k > >
| Declare big unsigned int is a number. More...
class | Dune::GMPField< precision >
| Number class for high precision floating point number using the GMP library mpf_class implementation. More...

## Macros

#define | DUNE_BINOP(OP)

## Functions

template<int k>
std::ostream & | Dune::operator<< (std::ostream &s, const bigunsignedint< k > &x)
template<int k>
bigunsignedint< k > | Dune::operator+ (const bigunsignedint< k > &x, std::uintmax_t y)
template<int k>
bigunsignedint< k > | Dune::operator- (const bigunsignedint< k > &x, std::uintmax_t y)
template<int k>
bigunsignedint< k > | Dune::operator* (const bigunsignedint< k > &x, std::uintmax_t y)
template<int k>
bigunsignedint< k > | Dune::operator/ (const bigunsignedint< k > &x, std::uintmax_t y)
template<int k>
bigunsignedint< k > | Dune::operator% (const bigunsignedint< k > &x, std::uintmax_t y)
template<int k>
bigunsignedint< k > | Dune::operator+ (std::uintmax_t x, const bigunsignedint< k > &y)
template<int k>
bigunsignedint< k > | Dune::operator- (std::uintmax_t x, const bigunsignedint< k > &y)
template<int k>
bigunsignedint< k > | Dune::operator* (std::uintmax_t x, const bigunsignedint< k > &y)
template<int k>
bigunsignedint< k > | Dune::operator/ (std::uintmax_t x, const bigunsignedint< k > &y)
template<int k>
bigunsignedint< k > | Dune::operator% (std::uintmax_t x, const bigunsignedint< k > &y)
| Dune::bigunsignedint< k >::bigunsignedint ()
| Construct uninitialized.
template<typename Signed>
| Dune::bigunsignedint< k >::bigunsignedint (Signed x, typename std::enable_if< std::is_integral< Signed >::value &&std::is_signed< Signed >::value >::type *=0)
| Construct from signed int.
| Dune::bigunsignedint< k >::bigunsignedint (std::uintmax_t x)
| Construct from unsigned int.
std::uint_least32_t | Dune::bigunsignedint< k >::touint () const
| export to other types
double | Dune::bigunsignedint< k >::todouble () const
| Convert to a double.
void | Dune::bigunsignedint< k >::print (std::ostream &s) const
| Print number in hex notation.
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator+= (const bigunsignedint< k > &x)
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator-= (const bigunsignedint< k > &x)
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator*= (const bigunsignedint< k > &x)
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator++ ()
| prefix increment
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator/= (const bigunsignedint< k > &x)
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator%= (const bigunsignedint< k > &x)
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator&= (const bigunsignedint< k > &x)
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator^= (const bigunsignedint< k > &x)
bigunsignedint< k > & | Dune::bigunsignedint< k >::operator|= (const bigunsignedint< k > &x)
bigunsignedint< k > | Dune::bigunsignedint< k >::operator~ () const
| bitwise complement
bigunsignedint< k > | Dune::bigunsignedint< k >::operator<< (int i) const
| left shift
bigunsignedint< k > | Dune::bigunsignedint< k >::operator>> (int i) const
| right shift
bool | Dune::bigunsignedint< k >::operator!= (const bigunsignedint< k > &x) const
| not equal
bool | Dune::bigunsignedint< k >::operator== (const bigunsignedint< k > &x) const
| equal
bool | Dune::bigunsignedint< k >::operator< (const bigunsignedint< k > &x) const
| less than
bool | Dune::bigunsignedint< k >::operator<= (const bigunsignedint< k > &x) const
| less than or equal
bool | Dune::bigunsignedint< k >::operator> (const bigunsignedint< k > &x) const
| greater than
bool | Dune::bigunsignedint< k >::operator>= (const bigunsignedint< k > &x) const
| greater or equal

## Detailed Description

Class implementing different number representations and helper functions.

## Macro Definition Documentation

## DUNE_BINOP

#define DUNE_BINOP | ( |  | OP | ) |

Value:
template <int k> \
inline bigunsignedint<k> bigunsignedint<k>::operator OP (const bigunsignedint<k> &x) const \
{ \
auto temp = *this; \
temp OP##= x; \
return temp; \
}

## Function Documentation

## bigunsignedint() [1/3]

template<int k>

Dune::bigunsignedint< k >::bigunsignedint | ( |  | ) |

Construct uninitialized.

## bigunsignedint() [2/3]

template<int k>
template<typename Signed>

Dune::bigunsignedint< k >::bigunsignedint | ( | Signed | x,
|  | typename std::enable_if< std::is_integral< Signed >::value &&std::is_signed< Signed >::value >::type * | = 0 )

Construct from signed int.

## bigunsignedint() [3/3]

template<int k>

Dune::bigunsignedint< k >::bigunsignedint | ( | std::uintmax_t | x | ) |

Construct from unsigned int.

## operator!=()

template<int k>

bool Dune::bigunsignedint< k >::operator!= | ( | const bigunsignedint< k > & | x | ) | const

inline

not equal

## operator%() [1/2]

template<int k>

bigunsignedint< k > Dune::operator% | ( | const bigunsignedint< k > & | x,
|  | std::uintmax_t | y )

inline

## operator%() [2/2]

template<int k>

bigunsignedint< k > Dune::operator% | ( | std::uintmax_t | x,
|  | const bigunsignedint< k > & | y )

inline

## operator%=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator%= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator&=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator&= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator*() [1/2]

template<int k>

bigunsignedint< k > Dune::operator* | ( | const bigunsignedint< k > & | x,
|  | std::uintmax_t | y )

inline

## operator*() [2/2]

template<int k>

bigunsignedint< k > Dune::operator* | ( | std::uintmax_t | x,
|  | const bigunsignedint< k > & | y )

inline

## operator*=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator*= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator+() [1/2]

template<int k>

bigunsignedint< k > Dune::operator+ | ( | const bigunsignedint< k > & | x,
|  | std::uintmax_t | y )

inline

## operator+() [2/2]

template<int k>

bigunsignedint< k > Dune::operator+ | ( | std::uintmax_t | x,
|  | const bigunsignedint< k > & | y )

inline

## operator++()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator++ | ( |  | ) |

inline

prefix increment

## operator+=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator+= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator-() [1/2]

template<int k>

bigunsignedint< k > Dune::operator- | ( | const bigunsignedint< k > & | x,
|  | std::uintmax_t | y )

inline

## operator-() [2/2]

template<int k>

bigunsignedint< k > Dune::operator- | ( | std::uintmax_t | x,
|  | const bigunsignedint< k > & | y )

inline

## operator-=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator-= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator/() [1/2]

template<int k>

bigunsignedint< k > Dune::operator/ | ( | const bigunsignedint< k > & | x,
|  | std::uintmax_t | y )

inline

## operator/() [2/2]

template<int k>

bigunsignedint< k > Dune::operator/ | ( | std::uintmax_t | x,
|  | const bigunsignedint< k > & | y )

inline

## operator/=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator/= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator<()

template<int k>

bool Dune::bigunsignedint< k >::operator< | ( | const bigunsignedint< k > & | x | ) | const

inline

less than

## operator<<() [1/2]

template<int k>

bigunsignedint< k > Dune::bigunsignedint< k >::operator<< | ( | int | i | ) | const

inline

left shift

## operator<<() [2/2]

template<int k>

std::ostream & Dune::operator<< | ( | std::ostream & | s,
|  | const bigunsignedint< k > & | x )

inline

## operator<=()

template<int k>

bool Dune::bigunsignedint< k >::operator<= | ( | const bigunsignedint< k > & | x | ) | const

inline

less than or equal

## operator==()

template<int k>

bool Dune::bigunsignedint< k >::operator== | ( | const bigunsignedint< k > & | x | ) | const

inline

equal

## operator>()

template<int k>

bool Dune::bigunsignedint< k >::operator> | ( | const bigunsignedint< k > & | x | ) | const

inline

greater than

## operator>=()

template<int k>

bool Dune::bigunsignedint< k >::operator>= | ( | const bigunsignedint< k > & | x | ) | const

inline

greater or equal

## operator>>()

template<int k>

bigunsignedint< k > Dune::bigunsignedint< k >::operator>> | ( | int | i | ) | const

inline

right shift

## operator^=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator^= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator|=()

template<int k>

bigunsignedint< k > & Dune::bigunsignedint< k >::operator|= | ( | const bigunsignedint< k > & | x | ) |

inline

## operator~()

template<int k>

bigunsignedint< k > Dune::bigunsignedint< k >::operator~ | ( |  | ) | const

inline

bitwise complement

## print()

template<int k>

void Dune::bigunsignedint< k >::print | ( | std::ostream & | s | ) | const

inline

Print number in hex notation.

## todouble()

template<int k>

double Dune::bigunsignedint< k >::todouble | ( |  | ) | const

inline

Convert to a double.

Warning
  Subject to rounding errors!

## touint()

template<int k>

std::uint_least32_t Dune::bigunsignedint< k >::touint | ( |  | ) | const

inline

export to other types