LibreOfficeの計算精度

固有の精度の問題

LibreOffice Calcは、他の多くの表計算ソフトウェアと同様に、ハードウェアで利用可能な浮動小数点演算機能を使用します。現在のほとんどのハードウェアは、IEEE 754規格で定義された精度制限付きのバイナリ浮動小数点演算を使用しているため、多くの小数(0.1のような単純なものを含む)は、LibreOffice Calc(内部で64ビット倍精度数値を使用)では正確に表現できません。

Calculations with those numbers necessarily results in rounding errors, and those accumulate with every calculation.

This is not a bug, but is expected and currently unavoidable without using complex calculations in software, which would incur inappropriate performance penalties, and thus is out of question. Users need to account for that, and use rounding and comparisons with machine epsilon (or unit roundoff) as necessary.

数字を使った例

A

1

31000.99

2

32000.12

3

=A1-A2


この結果、A3には、予想されていた-999.13ではなく-999.129999999997が表示されます(これを確認するには、セル形式で表示されている小数点以下の桁数を増やす必要があります)。

ご支援をお願いします!