LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Single Precision Math

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.

Thanks in Advance

Leon
0 Kudos
Message 1 of 3
(2,977 Views)
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.
0 Kudos
Message 2 of 3
(2,976 Views)
Hello Leon,

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.


Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 3 of 3
(2,945 Views)