nathanpjones / DecimalMath

The math support for Decimal that Microsoft forgot and more.
MIT License
47 stars 13 forks source link

Updated log and pow methods. #13

Closed mossy2100 closed 2 years ago

mossy2100 commented 2 years ago

I found that the original DecimalEx.Log() hangs for very small argument values, so I made an alternative. I've called it Ln() but provided Log() as an alias and for backwards compatibility. It's tested but I need to add the tests to this branch. It's fast and doesn't break with the largest or smallest decimal values. I've also updated the related methods Log10() and Log2() to call the new method and leverage its exceptions, and added Pow10() and Pow2() for completeness.