DecimalMath icon indicating copy to clipboard operation
DecimalMath copied to clipboard

DecimalEx.Log does not return

Open cvxMR opened this issue 3 years ago • 1 comments

For small inputs, e.g. 0.000000002, DecimalEx.Log does not return or at least takes an absurd amount of time. For aforementioned value the algorithm requires ~1000000000 iterations to reach adequate precision (2 decimal places). This function should switch to a different algorithm for small values and this limitation should be mentioned in the readme and function comment. Also: if (nextAdd == 0) break; You never compare float/double/decimal with == or !=, especially when it is the only break condition in an infinite loop. Use Abs(x) < Tolerance instead.

cvxMR avatar Oct 20 '21 06:10 cvxMR

Just ran into that same issue...

3dGrabber avatar Mar 20 '23 14:03 3dGrabber