Skip to content

fixdfti test fails if float generation gets fixed #162

Closed
@est31

Description

@est31
Member

In build.rs, there is code to use the random generator to create floats.

It has a little bug though in the way it determines the exponent. The exponent is first &ed with the mask, and then shifted. The issue is though, the mask is already assuming a shifted value. So we end up with the expression always being 0.

Instead it should be first shifted, and then &ed with the mask, like ((exponent << (SIGNIFICAND_BITS -1)) & EXPONENT_MASK) |.

When doing this though, I discovered that the fixdfti test fails. I first thought it was a conversion my PR added, but its in fact already present.

The error looks like:

thread 'fixdfti' panicked at 'assertion failed: `(left == right)` (left: `((5179139571476070400,), -170141183460469231731687303715884105728)`, right: `((5179139571476070400,), 170141183460469231731687303715884105727)`)'

Activity

est31

est31 commented on May 7, 2017

@est31
MemberAuthor

This might be related to rust-lang/rust#10184

AaronKutch

AaronKutch commented on Apr 3, 2021

@AaronKutch
Contributor

This has been fixed by #397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Amanieu@est31@AaronKutch

        Issue actions

          fixdfti test fails if float generation gets fixed · Issue #162 · rust-lang/compiler-builtins