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.

Is this a bug in C64x+ IQMath Library (IQmath_pc.lib)?

I found a proplem when I use the function _IQNpow()

_iq16   ta, tb, tc;
float   fa1, fa2, q, fTest;

the following code is to solve  tc = a^(1/3)

q = 1.0/3.0;
fa1 = 0.027;
fa2 = 0.028;

ta = _FtoIQ16( fa1 );   
tb = _FtoIQ16( q );      
 tc = _IQ16pow( ta, tb );
 fTest = _IQ16toF( tc );       ---------->  fTest = 3.7575836    Correct

ta = _FtoIQ16( fa2 );   
tb = _FtoIQ16( q );      
 tc = _IQ16pow( ta, tb );
 fTest = _IQ16toF( tc );       ---------->  fTest = 0.26564026  Wrong

Anyone can help?

I found that for tc = a^(1/3)
if a >= 0.028, we get right results
if a <= 0.027 we get wrong results

 

  • Y Liu said:

    I found a proplem when I use the function _IQNpow()

    _iq16   ta, tb, tc;
    float   fa1, fa2, q, fTest;

    the following code is to solve  tc = a^(1/3)

    q = 1.0/3.0;
    fa1 = 0.027;
    fa2 = 0.028;

    ta = _FtoIQ16( fa1 );   
    tb = _FtoIQ16( q );      
     tc = _IQ16pow( ta, tb );
     fTest = _IQ16toF( tc );       ---------->  fTest = 3.7575836    Wrong

    ta = _FtoIQ16( fa2 );   
    tb = _FtoIQ16( q );      
     tc = _IQ16pow( ta, tb );
     fTest = _IQ16toF( tc );       ---------->  fTest = 0.26564026  Correct

    I found that for tc = a^(1/3)
    if a >= 0.028, we get right results
    if a <= 0.027 we get wrong results

    Anyone can help?