MPI-INF/SWS Research Reports 1991-2021

2. Number - All Departments


The LEDA class real number

Burnikel, Christoph and Mehlhorn, Kurt and Schirra, Stefan

January 1996, 52 pages.

Status: available - back from printing

We describe the implementation of the LEDA data type {\bf real}. Every integer is a real and reals are closed under the operations addition, subtraction, multiplication, division and squareroot. The main features of the data type real are \begin{itemize} \item The user--interface is similar to that of the built--in data type double. \item All comparison operators $\{>, \geq, <, \leq, =\}$ are {\em exact}. In order to determine the sign of a real number $x$ the data type first computes a rational number $q$ such that $|x| \leq q$ implies $x = 0$ and then computes an approximation of $x$ of sufficient precision to decide the sign of $x$. The user may assist the data type by providing a separation bound $q$. \item The data type also allows to evaluate real expressions with arbitrary precision. One may either set the mantissae length of the underlying floating point system and then evaluate the expression with that mantissa length or one may specify an error bound $q$. The data type then computes an approximation with absolute error at most $q$. \end{itemize} The implementation of the data type real is based on the LEDA data types {\bf integer} and {\bf bigfloat} which are the types of arbitrary precision integers and floating point numbers, respectively.The implementation takes various shortcuts for increased efficiency, e.g., a {\bf double} approximation of any real number together with an error bound is maintained and tests are first performed on these approximations. A high precision computation is only started when the test on the {\bf double} approximation is inconclusive.

  • MPI-I-96-1-001.pdfMPI-I-96-1-001.pdfMPI-I-96-1-001.psMPI-I-96-1-001.pdf
  • Attachement: (336 KBytes); MPI-I-96-1-001.pdf (387 KBytes); MPI-I-96-1-001.002.pdf (17987 KBytes)

URL to this document:

Hide details for BibTeXBibTeX
  AUTHOR = {Burnikel, Christoph and Mehlhorn, Kurt and Schirra, Stefan},
  TITLE = {The LEDA class real number},
  TYPE = {Research Report},
  INSTITUTION = {Max-Planck-Institut f{\"u}r Informatik},
  ADDRESS = {Im Stadtwald, D-66123 Saarbr{\"u}cken, Germany},
  NUMBER = {MPI-I-96-1-001},
  MONTH = {January},
  YEAR = {1996},
  ISSN = {0946-011X},