<div dir="ltr">Wow awesome, it would be nice if you could add it as a dub package (<a href="http://code.dlang.org/publish">http://code.dlang.org/publish</a>) to dub repository (<a href="http://code.dlang.org">http://code.dlang.org</a>)</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 8, 2018 at 11:16 PM, rumbu via Digitalmars-d-announce <span dir="ltr"><<a href="mailto:digitalmars-d-announce@puremagic.com" target="_blank">digitalmars-d-announce@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is my first D finalized project (+16k loc).<br>
<br>
I know that there are other two projects intended to provide a decimal data type for D, but I consider mine the most complete and most compliant to the standards (at least until now).<br>
<br>
There are two years of since I'm working on it (and learning D in the same time), but I concentrated most of the efforts in the last two months.<br>
<br>
It was a nice exercise because I was happy to remember the math I learn through my college years (trigonometry, logarithms, Taylor series, derivatives, etc). Unfortunately I'm not using the same math during my day-to day job.<br>
<br>
Maybe in another post I will share my struggles I encountered during the development (plenty of). But a big thank you goes to Rainer Schuetze: without Visual Studio and without the integrated debugger this project was impossible to maintain.<br>
<br>
Now on topic:<br>
<br>
- fully IEEE-754-2008 compliant;<br>
- one flat file;<br>
- using Intel's binary decimal enconding;<br>
- three decimal data types: decimal32, decimal64 and decimal128<br>
- all D operators supported for all numeric types (left and right side integrals, floats, chars);<br>
- conversion supported from/to integrals, floats, bools, chars<br>
- conversion to/from other decimal formats (Microsoft Currency, Microsoft Decimal, IBM Densely Packed Decimal)<br>
- all std.math functions implemented (even logarithms and trigonometry);<br>
- all format specifiers implemented (%f, %e, %g, %a);<br>
- integrated with phobos format and conversion functions (to, format, writef);<br>
- thread local precision (from 1 to 34 decimal digits);<br>
- new rounding mode - Europe's most used - tiesToAway;<br>
- alternate exception handling (through flags);<br>
- minimal dependencies (some traits and some floating point functions);<br>
- comprehensive documentation;<br>
<br>
Source code: <a href="https://github.com/rumbu13/decimal/blob/master/src/decimal.d" rel="noreferrer" target="_blank">https://github.com/rumbu13/dec<wbr>imal/blob/master/src/decimal.d</a><br>
<br>
Documentation: <a href="http://rumbu13.github.io/decimal/doc/decimal.html" rel="noreferrer" target="_blank">http://rumbu13.github.io/decim<wbr>al/doc/decimal.html</a><br>
<br>
The project is more than in an alpha state, all operations were tested but not exhaustively.<br>
<br>
What's next:<br>
- more tests;<br>
- benchmarks;<br>
<br>
<br>
</blockquote></div><br></div>