Re: [問題] 關於fixed point以及float point
※ 引述《LonGen (Longen)》之銘言:
: 大家好 有兩個問題
: 今天看一本書上寫到
: 第一個是"如果乘上2的n次方倍數,相當於將浮點數往左位移n個位元"
: 這是為什麼呢
浮點表示是用IEEE754表示法,位元移位會錯的。請參閱
http://squall.cs.ntou.edu.tw/cprog/Materials/FractionalNumber.html
: 另外一個問題
: 書上的標題是"Replacing floating point values with fixed-point"
: 裡面提到為了方便硬體運算 將floating point的數值轉成integer或long integer
: 後面提到一個例子
: "which is expressed by 16 bits needs two bits as the integer width,
: so the number of shifting bits is 13"
這是講定點運算(fixed-point)
同樣請參閱上面的Link....
: 有版友懂這段話的意思嘛?? 請教一下 非常感謝^^
--
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 編輯: MasterChang 來自: 140.132.20.82 (05/14 01:39)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章