Skip to content

[libc][math] sqrt(-infinity) not setting errno == EMOD or raising exceptions #88768

Open
@Flandini

Description

@Flandini

Following up on #61092, this case still remains.

Problems:

The ISA-specific implementations aren't setting errno == EDOM on negative, non-zero numbers.
The generic implementation and the sqrt_80_bit_long_double generic implementation do not set EDOM or raise FE_INVALID.

Potential fixes:

Fixes for the generic implementation seem straight forward.

I can add a check that the argument is less than zero before the asm sqrt insn in the ISA-specific impls; I would guess the best way to do this is with FPBits to avoid changing FP flags/exceptions?

Tagging @nickdesaulniers and @michaelrj-google.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions