Re: [轉錄]Re: [問題]請問如何四捨五入...

看板NTUGIEE_EDA作者 ( XD)時間20年前 (2006/03/30 15:22), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串9/10 (看更多)
※ 引述《Donnie ( XD)》之銘言: : ※ 引述《yellowfishie (喵喵喵喵~~~)》之銘言: : : linux: : : ori: 3.595e+06 : : cast_i: 3594998 : : cast_floor_i: 3594998 : : cast_ceil_i: 3594999 : : solaris: : : ori: 3.595e+06 : : cast_i: 3594998 : : cast_floor_i: 3594998 : : cast_ceil_i: 3594998 : 我剛發現 ntuplace 在 Intel 和 AMD 的 x86 上結果不同.... http://gcc.gnu.org/ml/gcc/2003-08/msg01183.html In the process of revamping the non-bugs section of the bug reporting instructions I came across a problem with the excess precision of the x86 FPU: I wanted to construct a very extreme case where rounding leads to unexpected behaviour and came up with the following example: ============================================ int main() { double x=sqrt(2.0); volatile double y=x; if (x!=y) printf("Uh oh!\n"); return 0; } ============================================ Compiling this with GCC 3.3.1 and using -O2 I get the output: "Uh oh!" -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.5.74

03/30 15:25, , 1F
我在lab機器跑沒有問題, 已經更新了?
03/30 15:25, 1F
文章代碼(AID): #14AuTASQ (NTUGIEE_EDA)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 9 之 10 篇):
文章代碼(AID): #14AuTASQ (NTUGIEE_EDA)