little-ant

借助math库的round函数

#include <math.h>
double ext_round(double data, int precision)
{
    double base = pow(10, precision);
        
    return round(data * base) / base;
}     

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-11-14
  • 2021-10-19
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2022-01-02
  • 2021-12-29
猜你喜欢
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2021-10-19
  • 2021-11-29
  • 2021-11-29
相关资源
相似解决方案