#include <biginteger.h>
Public Methods | |
biginteger () | |
biginteger (void *raw) | |
biginteger (const mpz_t &value_) | |
biginteger (int value_) | |
biginteger (double value_) | |
biginteger (const std::string &value_) | |
biginteger (const biginteger &rhs) | |
biginteger & | operator= (const biginteger &rhs) |
~biginteger () | |
void | setValue () |
void | setValue (mpz_t value_) |
const mpz_t & | getValueTemp () const |
bool | isNA () const |
std::string | str () const |
long | as_long () const |
double | as_double () const |
int | as_raw (void *raw) const |
size_t | raw_size () const |
void | swap (biginteger &other) |
int | isprime (int reps) |
The biginteger special state "NA" means, no value is assigned. This does not mean, the internal state is not constructed, but the value explicit is "not available".
|
Construct a "NA" biginteger. |
|
Construct a biginteger from a raw expression. |
|
Create a biginteger from a value. Remember to free the parameter's mpz_t if you allocated them by yourself - biginteger will copy the value. |
|
Construct a biginteger from a long value. |
|
Construct a biginteger from a double value. |
|
Construct a biginteger from a string value. |
|
Copy constructor (mpz_t aren't standard-copyable) |
|
Free the owned mpz_t structs |
|
Convert the biginteger into a double value (you may loose precision) |
|
Convert the biginteger into a long value (cut off the msb's if it don't fit). |
|
Convert the biginteger to a raw memory block. Obtain the size needed from biginteger_raw_size() first and make sure, the buffer provided is large enough to hold the data. Also remember, that the modulus is not saved this way. To obtain a modulus raw byte use get_modulus().as_raw(void*).
|
|
For const-purposes, return the value. Remember, that the return value only lives as long as this class live, so do not call getValueTemp on temporary objects. |
|
Return true, if the value is NA. |
|
Test prime numbers |
|
Asignment operator. |
|
Return the number of bytes needed to store this biginteger in a continous memory block. |
|
Set the biginteger to a specific value. |
|
Set the biginteger to state "NA". |
|
Convert the biginteger into a standard string. |
|
Swap values with the argument |