Skip to content

conv.i4 with NaN returns 0 on macOS M1  #86980

Closed
@aoli-al

Description

@aoli-al

Description

conv.i4 with NaN as input returns 0 on macOS M1

Reproduction Steps

Run the following code on macOS M1

Console.WriteLine($"{(int) Math.Log(-1)}")

Expected behavior

On an X86 machine it prints -2147483648

Actual behavior

Prints 0

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

I understand casting NaN to integer is unspecified behaviour. However, I'm wondering if the runtime should produce the same output on different architectures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions