Does decimal math use FPU

Does decimal math use FPU?

I would think the answer is yes, but I'm not sure, since the decimal value is not a floating point, but a fixed precision number.

I am mostly looking for .NET, but a general answer is also helpful.

+4
source share
2 answers

As for .NET, and more specifically, C #, no, System.Decimal does not use FPU, because the type is emulated in software.

In addition, System.Decimal is a floating point number, not a fixed-precision number commonly found in a database. The type is actually a decimal floating point that uses 10 for its base, and not for a binary floating point (i.e. System.Single or System.Double ), which uses 2 as its base. It still has the same problems with accuracy if you try to save a fraction that cannot be accurately represented, such as 1/3.

+3
source

Yes, modern languages ​​generally support floating point math and integer math, and that it; no direct support for fixed point, BCD, etc. Floating-point math will be performed using floating-point processor instructions; modern architectures do not include a separate FPU.

+1
source

Source: https://habr.com/ru/post/1395069/


All Articles