-
Notifications
You must be signed in to change notification settings - Fork 15
DecimalEx.Log does not return #11
Copy link
Copy link
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels