Skip to content

Float truthiness doesn't make sense #23704

Description

@rikkimax

Truthiness for floats doesn't make a whole lot of sense:

void main()
{
     int a;
     assert(!a); // ok
     float b;
     assert(!b); // fails
}

Source: https://forum.dlang.org/post/vlvgvmedfprqubznvwww@forum.dlang.org

Between NaN, -0, infinity and all the other cases, it really doesn't align with the subject at all.

Good candidate for removal in an edition.

Activity

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

      Issue actions