Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (-Inf)^-1 inconsistency #55875

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oscardssmith
Copy link
Member

fixes #55831
Turns out all we needed was to change the xnlo initialization. @nsajko mind if I steal your testset?

@oscardssmith oscardssmith added domain:maths Mathematical functions kind:bugfix This change fixes an existing bug labels Sep 25, 2024
@giordano giordano added the needs tests Unit tests are required for this change label Sep 25, 2024
Copy link
Contributor

@nsajko nsajko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Here's the testset:

@testset "inconsistency, possible bug" begin
    @testset "T: $T" for T  (Float16, Float32, Float64, BigFloat)
        @testset "literal `-1`" begin
            @test -0.0 === Float64(T(-Inf)^-1)
        end
        @testset "`Int(-1)`" begin
            @test -0.0 === Float64(T(-Inf)^Int(-1))
        end
    end
end

Trying it locally shows that the inconsistency is gone with the PR.

@oscardssmith oscardssmith removed the needs tests Unit tests are required for this change label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:maths Mathematical functions kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(-Inf)^-1 inconsistency for Float64
3 participants