0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

理科の有効数字とコンピューターの有効数字

Posted at

はじめに

同じ単語なのに、分野が異なると意味も異なることがあります。
今回は「有効数字」について、理科の文脈とコンピュータの文脈での違いを整理しました。

まず、それぞれの意味を確認し、実際に結果が異なるパターンを示します。

理科における有効数字

理科の有効数字は、測定値や計算結果の信頼できる桁を示す。
・測定器の精度や誤差に依存する
・小さい値を大きい値に足す場合、元の値の精度によっては小さい値は無視される

コンピュータにおける有効数字

コンピュータの有効数字は、有限のビット数で数値を表現できる桁数のこと。

「有効数字」というより「精度」といった方が正確

・float(単精度32bit)の有効数字は約7桁
・値が大きすぎると、小さい数を足しても丸められ消えてしまう

具体例

例1:1万(1.0 × 10^4) + 25

項目 結果 備考
理科 1.0 × 10^4 有効数字 2桁なので 25 は無視
コンピュータ (float) 10025 7桁以内なので正確に計算可能

例2:1兆(1.0 × 10^12 ) + 25

項目 結果 備考
理科 1.0 × 10^12 有効数字 2桁なので 25 は無視
コンピュータ (float) 1.0 × 10^12 約7桁しか保持できないため、25は丸め誤差で消える

まとめ

ざっくり違いをまとめると

  • 理科 → 「信頼できないから無視する」
  • コンピュータ → 「能力的に無理だからあきらめる」
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?