Closed
Description
The specification doesn't say negative numbers should fail a multipleOf
constraint, yet the current documentation fails -49.89
with a multipleOf
value of 0.01
.
Funnily enough, the implementation of this constraint has some edge cases where it lets negative numbers pass:
Calling the NumberConstraint::fmod
function with the parameters:
-49.89
and0.01
: returns-0.01
, thus fails-49.88
and0.01
: returns-0
, which passes due to the non-strict comparison in theNumberConstraint::check
function.
Calling abs()
on the first argument of NumberConstraint::fmod
should both fix this inconsistency and bring multipleOf
in line with the spec.
Metadata
Metadata
Assignees
Labels
No labels