V_setFPAccuracy
FunctionSet the coprecessor to a specific precision
Syntax C/C++#include <VecLib.h>
void V_setFPAccuracy( unsigned level );
Pascal/Delphiuses VecLib;
procedure V_setFPAccuracy( level:UInt );
DescriptionThis function changes the FPU Control-Word to switch the FPU to a specified accuracy, passed to the function as the argument level. For level=1, float / Single precision is obtained, level=2 leads to double precision, whereas level=3 switches the FPU into extended precision. The actual accuracy the coprocessor is switched to may be read through V_getFPAccuracy.
Operating the floating-point processor at float / Single precision may significantly speed up program execution, especially for any functions involving divisions (on Pentium or higher). This is true for functions (including OptiVec functions) of any floating-point data type. Thereby, you may even operate VD_ and VE_ functions at float / Single accuracy ? preserving double or extended range, but calculating results to single precision only.
On the other hand, as some versions of Windows XP and Vista automatically reduce the accuracy to double-precision instead of the standard 80-bit extended precision, you may actually wish to set V_setFPAccuracy( 3 ); in order to get full-precision results from the VD_ and VE_ functions.
There are several groups of functions which rely on full coprocessor accuracy for intermediate results, or which use precision-controlled iterations. Obviously, if the FPU operates in single precision only, such a function will never attain double precision and may get caught in an infinite loop. You should never call any of the following functions while the FPU is switched to single precision (or, for VE_ functions, to double precision):
V?_Kepler,
M?_SVdecompose,
or any of the nonlinear data fitting functions like VF_nonlinfit.
Return valuenone
See alsoV_getFPAccuracy

VectorLib Table of Contents  OptiVec home