Decimal “is based on a floating-point model which was designed with
people in mind, and necessarily has a paramount guiding principle –
computers must provide an arithmetic that works in the same way as the
arithmetic that people learn at school.”
Floating point numbers are usually implemented using double in C; information about the precision and internal representation of floating point numbers for the machine on which your program is running is available in sys.float_info.
如果要对这些数据执行数学运算,精度是个问题,我建议您看看decimal data type我们遇到的浮点错误问题。
根据documentation:
相关问题 更多 >
编程相关推荐