Python浮点数计算精度问题

2025-03-18 18:38:02
推荐回答(1个)
回答1:

方法一:使用格式化字符串来实现: print "%e" % 0.0001
方法二:修改floatobject.c里format_float里snprintf的参数,然后重新编译。