Skip to content

ZeroToOne division implementation breaks invariant of [0, 1] #120

@saona-raimundo

Description

@saona-raimundo

Hi! Thanks for the crate!

I come from your last post :)

I was checking your implementation of ZeroToOne and notice something.
You mentioned

ZeroToOne is a floating point number that is guaranteed to be between 0.0 and 1.0, inclusive.

But the implementation of division seems to break this.

There are various fixes: clamp after each division, check before dividing, etc.
Notice that the implementation of Div, DivAssign and Div<f32> are affected.

I say it "seems to break" because I could not compile cushy 0.2 in Windows :/
(error[E0446]: crate-private type InvalidationStatus in public interface)
I have not tested this repo yet.

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