Fixed point vs Floating point number Ask Question

Fixed point vs Floating point number Ask Question

I just can't understand fixed point and floating point numbers due to hard to read definitions about them all over Google. But none that I have read provide a simple enough explanation of what they really are. Can I get a plain definition with example?

ベストアンサー1

固定小数点数には、整数部 (小数点の左側の部分) 用に予約された特定の数のビット (または桁) と、小数部 (小数点の右側の部分) 用に予約された特定の数のビットがあります。数値がどれだけ大きいか小さいかに関係なく、各部分には常に同じ数のビットが使用されます。たとえば、固定小数点形式が 10 進数の場合IIIII.FFFFF、表現できる最大の数は で99999.99999、ゼロ以外の最小の数は です00000.00001。このような数値を処理するコードの各ビットには、小数点の位置に関する組み込みの知識が必要です。

浮動小数点数は、整数部や小数部に特定のビット数を予約しません。代わりに、数値に特定の数のビットを予約します(仮数または仮数)と、言うべきビット数どこその数字の中に小数点(指数)。したがって、指数用に 2 桁を確保した 10 桁の浮動小数点数は、 の最大値9.9999999e+50と のゼロ以外の最小値を表す可能性があります0.0000001e-49

おすすめ記事