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.

BQ34Z100-G1: Floating Point conversion

Part Number: BQ34Z100-G1
Other Parts Discussed in Thread: BQ34Z100

Tool/software:

Im currently working on a current calibration function in C++ for the BQ34z100. In order to do the current calibration I need to convert my calculated CC Gain and CC Delta to floating point representation. 

The floating point representation conversion is explained in the following image : 

All images are from the following forum discussion : BQ34Z100-G1: Commands for calibration procedure - Power management forum - Power management - TI E2E support forums

I was wondering if there was an available example of the floating point representation conversion in C++. I followed the instructions on the image but the function doesn't seem to work as its supossed to.

In the image the use the term "LHS of decimal", after some research the doing a cast of the "double" to an "int" is the closest thing I found.

Thanks in advance.

  • Hello Pierre,

    We do not have example code for this. Yes, I believe LHS should be a truncated left of the decimal. Check whether a cast of double to int does a rounding up in the case of 0.5 

    Regards,

    Adrian