Algorithmic Solutions > LEDA > LEDA Guide > Number Types

Number Types

The number types int, float, and double provided by C++ are only crude approximations of the mathematical counterparts: ints can overflow, the arithmetic for floats and doubles incurs rounding errors.

In some areas, especially computational geometry and network algorithms, it is very important to have exact results or, at least, to know bounds on the error of the result.

Examples for the dangers of floating point arithmetic

Therefore, LEDA provides different number types that solve the problem of inexact arithmetic:

Data types that always give mathematically correct answers:

Data type with rounding, but the rounding precision can be arbitrarily large:

Data types for improving the speed of an exact arithmetic type:

Data types for linear algebra:

Functions of numerical analysis, like computation of minima/maxima, integration, and root finding.

See also:

Simple Data Types

Graph Types

Graph Algorithms


Geometry Algorithms

Windows and Panels




Please send any suggestions, comments or questions to
© Copyright 2001-2003, Algorithmic Solutions Software GmbH