From 2fe69c4c8d95cabfb8fa9c0e819934a86ca796df Mon Sep 17 00:00:00 2001 From: Michael Hemmer Date: Mon, 1 Dec 2008 15:00:35 +0000 Subject: [PATCH] some words about required mantissa length refering to CGAL::Protect_FPU_rounding --- .../doc_tex/Modular_arithmetic/main.tex | 11 ++++++----- .../doc_tex/Modular_arithmetic_ref/Residue.tex | 12 +++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex index 38bd5f984fd..72a1607004d 100644 --- a/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex @@ -25,11 +25,12 @@ Since the type is based on double arithmetic the prime is restricted to values less than $2^{26}$. The initial value of $p$ is 67111067. -Please note that the implementation of class \ccc{CGAL::Residue} requires that -doubles are rounded to nearest, that is, it indispensable that the -rounding mode is set accordingly before performing any arithmetic operations. -For instance you may use \ccc{CGAL::Protect_FPU_rounding} with -\ccc{CGAL_FE_TONEAREST}. +Please note that the implementation of class \ccc{CGAL::Residue} requires a mantissa +precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754). +However, on some processors the traditional FPU uses an extended precision. Hence, it +is indispensable that the proper mantissa length is enforced before performing +any arithmetic operations. For instance you may use \ccc{CGAL::Protect_FPU_rounding} with +\ccc{CGAL_FE_TONEAREST}, which enforces the required precision as a side effect. \begin{ccAdvanced} In case the flag \ccc{CGAL_HAS_THREADS} diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Residue.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Residue.tex index b84bf60f206..02dee56c3fd 100644 --- a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Residue.tex +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Residue.tex @@ -17,11 +17,13 @@ old prime and can be reused after restoring the old prime. Since the type is based on double arithmetic the prime is restricted to values less than $2^{26}$. The initial value of $p$ is 67111067. -Moreover, the implementation of class \ccc{CGAL::Residue} requires that -doubles are rounded to nearest, that is, it indispensable that the -rounding mode is set accordingly before performing any arithmetic operations. -For instance you may use \ccc{CGAL::Protect_FPU_rounding} with -\ccc{CGAL_FE_TONEAREST}. + +Please note that the implementation of class \ccc{CGAL::Residue} requires a mantissa +precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754). +However, on some processors the traditional FPU uses an extended precision. Hence, it +is indispensable that the proper mantissa length is enforced before performing +any arithmetic operations. For instance you may use \ccc{CGAL::Protect_FPU_rounding} with +\ccc{CGAL_FE_TONEAREST}, which enforces the required precision as a side effect. In case the flag \ccc{CGAL_HAS_THREADS} is undefined the prime is just stored in a static member