Skip to content

[NativeAOT] Rounding helpers use wrong rounding algorithm #97922

@filipnavara

Description

@filipnavara

RhpFltRound/RhpDblRound are implemented using round/roundf. That's incorrect, since .NET default is round to even. Similar issue was recently fixed in NativeAOT-LLVM.

Unfortunately, roundeven/roundevenf methods are only available in C23 standard. They are implemented on glibc 2.25+ (current .NET requirement is 2.23) and missing on Bionic/MUSL libc. CoreCLR uses a custom implementation which can presumably be reused.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions