一個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
恩...我無言了...= =''