You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a package developer, in order to require that numbers be multiples of a given step (JSON Schema multipleOf), I would like to reject values that are not evenly divisible by a base value.
Details
JSON Schema multipleOf requires that a numeric instance be divisible by a positive number with no remainder (e.g. multipleOf: 2 for even integers, multipleOf: 0.01 for currency). stbl has no such constraint.
Summary
Details
JSON Schema
multipleOfrequires that a numeric instance be divisible by a positive number with no remainder (e.g.multipleOf: 2for even integers,multipleOf: 0.01for currency). stbl has no such constraint.Proposed signature
Arguments
multiple_of(numeric(1), positive) — Each value must be an integer multiple of this.NULL(default) skips the check.Returns the coerced numeric vector, unchanged when all elements are multiples.
Behavior
locationsobject in conditions for element-wise failures #274).dbl, use a tolerance to avoid floating-point false negatives (document the approach).intanddblstabilizers, their_scalar()variants, andspecify_int()/specify_dbl().References