constrainValue
float float float float
constrainValue は 「元に戻す」が可能、「照会」が不可能、「編集」が不可能 です。
与えられた開始/終了値の範囲の 3 番目の引数の整数乗数を、float 値で返します。 最初の引数は、範囲の開始値を表します。float |
// All the the examples use a range from 3.0 to 9.0, and a by value of 1.5. // // 0.0 is less than the start value (3.0), so the value is clamped to 3.0. // constrainValue 3.0 9.0 1.5 0.0; // Result: 3 // // 12.0 is greater than the end value (9.0), so it gets clamped to 9.0 // constrainValue 3.0 9.0 1.5 12.0; // Result: 9 // // For a value of 8.0, The answer is ( 3.0 + ( 1.5 * 3 ) ) which is to say // it is ( start + ( by * n ) ) where n is an integer. // constrainValue 3.0 9.0 1.5 8.0; // Result: 7.5 // // The answer is ( 3.0 + ( 1.5 * 2 ) ), which is less than 7.0 // constrainValue 3.0 9.0 1.5 7.0; // Result: 6 //