AnsweredAssumed Answered

floating to fraction

Question asked by Ahn Joseph on Jan 25, 2016
Latest reply on Jan 26, 2016 by ZhangJennie

MCU : s12zvl

CW:  10.6

 

  I need to convert a floating point variable ram to fraction value for Using Fraction Lib

 

  float f_t1;

  tFrac16 test_frac1,test_frac2  ;

 

 

  f_t1=0.5;

  test_frac1 = FRAC16(0.5); // <--- O.K

  test_frac1 = FRAC16(f_t1) ; // Compile Err

 

 

How can i do ?

Outcomes