79722492

Date: 2025-08-01 12:13:46
Score: 0.5
Natty:
Report link

AFAIK: the decNumber library intentional doesn't support decSingle for
calculations because the IEEE 754 standard defines them ( decimal32
types ) as "interchange format" and "arithmetic format" ( which can be
used to represent values ), however not as "basic format" ( which can
be used to perform arithmetic operations ( choosing names isn't easy ).

Workaround: convert to decNumber, calculate and convert back.

Alternative: "Libdfp", BID format, supports decimal32 calculations, ok
for basic arithmetic, shortcomings in speed and accuracy for anything
more complex.

Alternative 2: "Mpdecimal" by Stefan Krah, provides settings to calculate
with IEEE 754 decimal32 compatible settings.

Both Alternatives lack some functions, e.g. trigonometrics.

To mention as strong point for decNumber: very fast in input / output.
I managed to use decSingle in "vanilla-C", however not in "C++".

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: user1018684