Skip to content

Comparison of negative zero float #7

@Zubnix

Description

@Zubnix

Currently the equals operation of MatN compares the raw bits of the float values wrapped by the MatN objects. However in case of -0.0f and 0.0f these are considered not equal, while in fact they should be (from a practical point of view).

Would it be beneficial to do a temp. negative to positive zero conversion while comparing MatN objects?

The reason I'm asking is because I implemented a Matrices.inverse(Mat4 mat) method on my fork, and my unit test fails because of the above description. I can fix it using this method it but I'd rather ask first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions