0
点赞
收藏
分享

微信扫一扫

有人会算吗,帮帮忙

善解人意的娇娇 2022-02-03 阅读 42
c语言

int x_int=2100;

float x_max-30;

float x_min= -30;

int bits=12;

float uint_to_float(int x_int, float x_min, float x_max, int bits)
{
  /// converts unsigned int to float, given range and number of bits ///
  float span = x_max - x_min;//计算差值
  float offset = x_min;
  return (((float)x_int)*span/((float)((1<<bits)-1)) + offset);
  }

return=????

举报

相关推荐

0 条评论