applyDeadband

fun Number.applyDeadband(deadband: Number, maxMagnitude: Number = 1): Double

Returns 0.0 if the given value is within the specified range around zero. The remaining range between the deadband and the maximum magnitude is scaled from 0.0 to the maximum magnitude.

Return

The value after the deadband is applied.

Parameters

deadband

Range around zero.

maxMagnitude

The maximum magnitude of the input. Can be infinite.


@JvmName(name = "applyDeadbandInfix")
infix fun Number.applyDeadband(deadband: Number): Double

Returns 0.0 if the given value is within the specified range around zero. The remaining range between the deadband and the maximum magnitude is scaled from 0.0 to the maximum magnitude. Maximal magnitude is 1 for this infix overload.

Return

The value after the deadband is applied.

Parameters

deadband

Range around zero.