Skip to content

log10 generate wrong odd result when input is a float type number equal to pow(1.0, a negative even number) #44

@a5632645

Description

@a5632645

Snipaste_2024-06-09_16-48-34

When input is 1.0 to a negative even float type number, gcem::log10 return a wrong negative odd number.

Eg: gcem::log10(0.01) = -1.0f, should be -2.0f

Tested with 1e-2f to 1e-26f, only the 1e-22f is right.
In double and long double type, this also happens to 1e-12 and 1e-14.

Envrioment: MSVC 14.41.33901, C++20 std
GCE-Math version 1.18.0

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