I have a application that requires all math functions to be done in single precision. In the Microsoft world the function _controlfp let me have direct access to the data size at the processor level. Does anyone know of a library call in CVI development system that allows me to change the precison of values to 32 bits? If so could you point me in the right direction.
As far as I know, CVI functions only do double precision math. My company's NI hardware driver dlls require simgle precision output so we just sue something like:
for (j=0;jNLines;j++)MeasSpectrumResults->PData[j] = (float)DSPArrays.dbuf[j+1];
Computationally, there's very little benefit in using single precision variables other than storage space and bus loading during processing. Single precision values are calculated as doubles anyway.
All our math libraries only support 64 bit precision. Also, with the CVI compiler, we do not have access to the _control87 or _controlfp system functions. If at all possible, I would suggest implementing the ideas Duncan previously posted.