On Wed, 27 Mar 2024 18:30:24 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

> the end result of stepping once by `amountToStepBy` must be equivalent of 
> incrementing by one a total of `amountToStepBy` times, wouldn't you agree?

Yes, this is the expectaion.

> so the formula for positive `amountToStepBy` values should look like
> 
> `((val + amountToStepBy) % (max - min)) + min`
> 
> or something along these lines.

Not quite. Because the range is inclusive on both ends, the number of discrete 
positions is `max - min + 1`. In your above example , where `min=0` and 
`max=100`, there are 101 discrete positions. A single step by 101 or 101 steps 
by 1 will both bring you back to the same position you started from.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1431#issuecomment-2023752621

Reply via email to