decimal 0.9.0

IEEE-754-2008 decimal floating point implementation


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

decimal

D implementation of floating point decimal data type according to IEEE-754-2008

Why

  • 1.1 + 2.2 = 3.3 (decimal) but 1.1 + 2.2 = 3.3000000000000003 (float)

  • 0.45 = 0.45 (decimal) but 0.45 = 0.450000018 (float)

Features:

  • fully IEEE-754-2008 compliant;
  • using Intel's binary decimal enconding;
  • three decimal data types: decimal32, decimal64 and decimal128
  • all D operators supported for all numeric types (left and right side integrals, floats, chars);
  • conversion supported from/to integrals, floats, bools, chars
  • conversion to other decimal formats (Microsoft Currency, Microsoft Decimal, IBM Densely Packed Decimal)
  • all std.math functions implemented (even logarithms and trigonometry);
  • all format specifiers implemented (%f, %e, %g, %a);
  • integrated with phobos format and conversion functions (to, format, writef);
  • thread local precision (from 1 to 34 decimal digits);
  • new rounding mode - Europe's most used - tiesToAway;
  • alternate exception handling (through flags);
  • minimal dependencies (some traits and some floating point functions);
  • comprehensive documentation;

Documentation: http://rumbu13.github.io/decimal/doc/decimal.html

Authors:
  • Razvan Stefanescu
Dependencies:
none
Versions:
0.9.1 2018-Jan-31
0.9.0 2018-Jan-09
~master 2018-Feb-10
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 3 downloads this month

  • 6 downloads total

Score:
1.0
Short URL:
decimal.dub.pm