31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Non-member functions<br />

double to double(const integer& a)<br />

returns a double floating point approximation of a.<br />

integer sqrt(const integer& a) returns the largest integer which is not larger than<br />

the square root of a.<br />

integer abs(const integer& a) returns the absolute value of a.<br />

integer gcd(const integer& a, const integer& b)<br />

returns the greatest common divisor of a and b.<br />

int log(const integer& a) returns the logarithm of a to the basis 2.<br />

int sign(const integer& a) returns the sign of a.<br />

integer sqr(const integer& a) returns a 2 .<br />

integer integer :: random(int n) returns a random integer of length n bits.<br />

4. Implementation<br />

An integer is essentially implemented by a vector vec of unsigned long numbers. <strong>The</strong><br />

sign and the size are stored in extra variables. Some time critical functions are also<br />

implemented in assembler code.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!