討論串[問題] int()的奇怪現象
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓6(6推 0噓 8→)留言14則,0人參與, 最新作者yongtw123 (六円)時間16年前 (2009/02/27 01:12), 編輯資訊
0
0
0
內容預覽:
#include <iostream>. #include <cmath>. #include <string>. using namespace std;. int main(). {. int m, x, y, z;. input:. cout<<"input: ";. cin>>x>>y>>z
(還有249個字)

推噓1(1推 0噓 2→)留言3則,0人參與, 最新作者VictorTom (鬼翼&娃娃魚)時間16年前 (2009/02/27 13:06), 編輯資訊
1
0
0
內容預覽:
#include <stdio.h>. union T. {. double d;. unsigned int i[2];. };. T t;. t.d = (4.0/7)*(pow(y,1.75)-pow(x,1.75))+(8.0/z);. cout<<t.d<<endl<<endl;. pri
(還有642個字)

推噓1(1推 0噓 3→)留言4則,0人參與, 最新作者yongtw123 (六円)時間16年前 (2009/02/27 13:35), 編輯資訊
1
0
0
內容預覽:
話說這是程式設計課的第一個作業.... 第一回就碰到這麼多問題. 雖然大大的程式碼和解釋有7成不太懂 (XD). 但重點是"精確度". 於是我就想到利用round(). 再用floor(). 問題就解決了!. 感謝! 噢!. 學到一課了啊!. --. 發信站: 批踢踢實業坊(ptt.cc). ◆

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者wowtiger (小虎)時間16年前 (2009/02/27 22:13), 編輯資訊
0
0
0
內容預覽:
IEEE754 的 round 定義. nearest 四捨六入五雙入. ceil 朝無限大近位. floor 朝無限小近位. truncate 小數設為零 <- 為 C 語言通用型態. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 114.44.181.182.
首頁
上一頁
1
下一頁
尾頁