Skip to content

DecimalEx.Log does not return #11

@cvxMR

Description

@cvxMR

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions