How to convert 32-bit float to 8-bit signed char?

后端 未结 2 1120
旧巷少年郎
旧巷少年郎 2021-01-12 16:35

What I want to do is:

  1. Multiply the input floating point number by a fixed factor.
  2. Convert them to 8-bit signed char.

Note that most of

2条回答
  •  轮回少年
    2021-01-12 17:05

    Please check the IEEE754 standard format to store float values, first understand how this float and double get store in memory ,then you only came to know how to convert float or double to the char , it is quite simple .

提交回复
热议问题