一个double precision的运算式中print出来的值是-119.000000000000
但若取int却print出现-118,这当中出现了什么问题呢?
程式码大约如下:
double precision x,y
.
.
.
.
.
.
.
.
print*,(x-y)*10.0d+00, int((x-y)*10.0d+00)
结果:
-115.000000000000 -115
-116.000000000000 -116
-117.000000000000 -117
-118.000000000000 -118
-119.000000000000 -118
恩...我无言了...= =''