decimal 0.9.1

IEEE-754-2008 compliant decimal data type.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

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:
  • rumbu13
Dependencies:
none
Versions:
0.9.1 2018-Jan-31
0.9.0 2018-Jan-09
~master 2019-Sep-04
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 2 downloads this month

  • 137 downloads total

Score:
0.0
Short URL:
decimal.dub.pm