小数演算は FPU を使用しますか?
答えはイエスだと思いますが、小数は浮動小数点ではなく固定精度の数値であるため、よくわかりません。
私は主に.NETを探していますが、一般的な回答も役に立ちます。
.NET、より具体的にはC#に関してはSystem.Decimal
、タイプがソフトウェアでエミュレートされているため、いいえ、FPUを使用しません。
また、System.Decimal
は浮動小数点数であり、データベースで一般的に見られるような固定精度の数値ではありません。タイプは、実際には、ベースとして2を使用する2進浮動小数点(つまり、または)とは対照的に、ベースとして10を使用する10進浮動小数点です。たとえば1/3のように、正確に表現できない分数を保存しようとすると、同じ精度の問題が発生します。System.Single
System.Double
Yes, modern languages in general support floating point math and integer math, and that's it; there's no direct support for fixed point, BCD, etc. Floating-point math is going to be done using floating-point processor instructions; modern architectures don't include a separate FPU.