Announcing version 3.0 of the 'decimal' library: elementary and trigonometric functions, better performance, and more.

35 views
Skip to first unread message

er...@ericlagergren.com

unread,
Jan 30, 2018, 5:00:08 PM1/30/18
to gonum-dev

Hi, I figured it was time to finish up version 3.0 of my decimal library. This is probably the largest release yet, mostly because I kept kicking the date down the road. :-)

New in this version:

  • a working math sub-package complete with elementary (exp, log, etc.) and trigonometric (sin, cos, etc.) functions. Much thanks to Nathan Hack for his help there. It also boasts multiple continued fraction and binary splitting algorithms.

  • performance improvements. I went through the code trying to remove as many allocations as possible, since they're easy to incur in an arbitrary-precision library. The general case performance isn't too much better, but overall it should perform better than before.

  • methods on Context. Before, it was annoying to do an operation with an explicit precision, rounding mode, etc. This made writing some mathematical functions difficult (since they rely on always using decimal.ToNearestEven, for example). So, for all the relevant arithmetic operations I've added methods on Context. The original methods still exist, of course. This new method is the "blessed" way as it's more explicit and not too much more verbose.

  • new test suite. Python's decimal package (which uses libmpdec) is robust and perhaps the standard-bearer for the GDA spec, so I've migrated my test suite to match it. This has helped me find a bunch of subtle bugs and adhere to the spec better.

  • a nearly-completed implementation. There are only a couple (rarely used) parts of the spec left to complete.

Also: I know some companies and individuals are using it, so if you could let me know how you're using it that'd be greatly appreciated. Nothing too specific is needed, I just want to know what parts of the code to optimize and for what use case.

As always, please break it (good luck...) and if you do, let me know!


(PS: I was told to post here by some gophers in Slack.)

Brendan Tracey

unread,
Jan 31, 2018, 9:30:49 AM1/31/18
to er...@ericlagergren.com, gonum-dev
Thanks for the announcement!

--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sebastien Binet

unread,
Jan 31, 2018, 9:46:46 AM1/31/18
to Brendan Tracey, er...@ericlagergren.com, gonum-dev
On Wed, Jan 31, 2018 at 3:30 PM, Brendan Tracey <tracey....@gmail.com> wrote:
Thanks for the announcement!


On Jan 30, 2018, at 3:00 PM, er...@ericlagergren.com wrote:

Hi, I figured it was time to finish up version 3.0 of my decimal library. This is probably the largest release yet, mostly because I kept kicking the date down the road. :-)

New in this version:

  • a working math sub-package complete with elementary (exp, log, etc.) and trigonometric (sin, cos, etc.) functions. Much thanks to Nathan Hack for his help there. It also boasts multiple continued fraction and binary splitting algorithms.

  • performance improvements. I went through the code trying to remove as many allocations as possible, since they're easy to incur in an arbitrary-precision library. The general case performance isn't too much better, but overall it should perform better than before.

  • methods on Context. Before, it was annoying to do an operation with an explicit precision, rounding mode, etc. This made writing some mathematical functions difficult (since they rely on always using decimal.ToNearestEven, for example). So, for all the relevant arithmetic operations I've added methods on Context. The original methods still exist, of course. This new method is the "blessed" way as it's more explicit and not too much more verbose.

  • new test suite. Python's decimal package (which uses libmpdec) is robust and perhaps the standard-bearer for the GDA spec, so I've migrated my test suite to match it. This has helped me find a bunch of subtle bugs and adhere to the spec better.

  • a nearly-completed implementation. There are only a couple (rarely used) parts of the spec left to complete.

Also: I know some companies and individuals are using it, so if you could let me know how you're using it that'd be greatly appreciated. Nothing too specific is needed, I just want to know what parts of the code to optimize and for what use case.

As always, please break it (good luck...) and if you do, let me know!


(PS: I was told to post here by some gophers in Slack.)

yeah, I am the one that suggested this post.
mainly because very recently somebody asked about finance-related packages on gonum.
I thought your package was right on :)

-s


--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+unsubscribe@googlegroups.com.

er...@ericlagergren.com

unread,
Feb 1, 2018, 12:37:30 AM2/1/18
to gonum-dev
Thank you for letting me know about this group, Sebastian!


On Wednesday, January 31, 2018 at 2:46:46 PM UTC, Sebastien Binet wrote:
On Wed, Jan 31, 2018 at 3:30 PM, Brendan Tracey <tracey....@gmail.com> wrote:
Thanks for the announcement!


On Jan 30, 2018, at 3:00 PM, er...@ericlagergren.com wrote:

Hi, I figured it was time to finish up version 3.0 of my decimal library. This is probably the largest release yet, mostly because I kept kicking the date down the road. :-)

New in this version:

  • a working math sub-package complete with elementary (exp, log, etc.) and trigonometric (sin, cos, etc.) functions. Much thanks to Nathan Hack for his help there. It also boasts multiple continued fraction and binary splitting algorithms.

  • performance improvements. I went through the code trying to remove as many allocations as possible, since they're easy to incur in an arbitrary-precision library. The general case performance isn't too much better, but overall it should perform better than before.

  • methods on Context. Before, it was annoying to do an operation with an explicit precision, rounding mode, etc. This made writing some mathematical functions difficult (since they rely on always using decimal.ToNearestEven, for example). So, for all the relevant arithmetic operations I've added methods on Context. The original methods still exist, of course. This new method is the "blessed" way as it's more explicit and not too much more verbose.

  • new test suite. Python's decimal package (which uses libmpdec) is robust and perhaps the standard-bearer for the GDA spec, so I've migrated my test suite to match it. This has helped me find a bunch of subtle bugs and adhere to the spec better.

  • a nearly-completed implementation. There are only a couple (rarely used) parts of the spec left to complete.

Also: I know some companies and individuals are using it, so if you could let me know how you're using it that'd be greatly appreciated. Nothing too specific is needed, I just want to know what parts of the code to optimize and for what use case.

As always, please break it (good luck...) and if you do, let me know!


(PS: I was told to post here by some gophers in Slack.)

yeah, I am the one that suggested this post.
mainly because very recently somebody asked about finance-related packages on gonum.
I thought your package was right on :)

-s


--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages