Skip to content
Astera Technology

Specify allowed increments as well as a numeric range

Describe the valid value grid rather than accepting every value between endpoints.

Compare the rule with concrete cases

Original fictional length field accepts 0 to 1000 mm inclusive in increments of 250 mm starting from zero. Allowed values are 0,250,500,750,1000. A value of 300 is within range but off-grid.

Filled synthetic modelling cases
Input mmIn rangeOn 250-mm gridValidity
250YesYesValid
300YesNoInvalid
1000YesYesValid
Download editable CSV ↓

Work through the distinction

Range and increment are independent checks. Specify the grid origin too: a grid starting at 50 would admit a different set of values.

Is 750 allowed, and is 1250 allowed?

Show the worked answer

750 is allowed. 1250 lies on the grid but exceeds the upper bound, so it is invalid.

Acceptance wording to adapt

Accept length_mm only when it is one of 0,250,500,750,1000. Reject off-grid or out-of-range values; do not silently round a submitted value to the nearest grid point.

Related resources