This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IQmath Library question on integer conversion

Dear all,

I have a question about using the IQ math library.

I am trying to use the IQ math library to convert integer values into floats for use with IQ math functions.

I need to multiply two long integers together and later add them to a IQ1 number.  Is it better to cast the 32 bit integers to floats then convert to IQ1 or is it better to

use the IQNmpyI32 to convert them.  For example, is one more accurate or is one faster than the other?

So in one case I would do use the iqNmpyI32 functions and multiply times 1.0, (Here I'm just casting a long for clarity - they start out as type long).

_iq1 result  = _iq1mpyI32 ( _iq1(1.0), (long)number1)  *   _iq1mpyI32 ( _iq1(1.0), (long)number2);

Or is it better to type cast the longs to float or to double, (I'm using float in my example), i.e.

_iq1 result  = _iq1( (float)number1) * _iq1( (float)number2);

Is there another way to input integers to IQ math functions that I'm missing?

I wish the IQ math library document had a section on how to deal with integers as inputs to the functions. 

Thanks for your help.

Steve