JetBrains Rider 2026.1 Help

Code inspection: Inconsistent arguments passed to 'Math.Clamp()' method

This inspection reports a Math.Clamp call where the minimum value is greater than the maximum value. Such a call is invalid and usually means the bounds were passed in the wrong order or calculated incorrectly.

Example

var value = Math.Clamp(input, 10, 3);
var value = Math.Clamp(input, 3, 10);

Quick-fix

There is no dedicated quick-fix for this inspection. A typical correction is to swap or recalculate the bounds so the minimum is not greater than the maximum.

01 April 2026