Function rustduino::math::map[][src]

pub fn map(
    val: u64,
    in_min: u64,
    in_max: u64,
    out_min: u64,
    out_max: u64
) -> u64
Expand description

Maps a number from one data type to the another data type in a uniform ratio scale.

Arguments

  • val - a u64, the value which is to be mapped to any other data type.
  • in_min - a u64, the minimum value possible in the data type of val.
  • in_max - a u64, the maximum value possible in the data type of val.
  • out_min - a u64, the minimum value possible in the required data type for val.
  • out_max - a u64, the maximum value possible in the required data type for val.

Returns

  • a u64 - the final value of val in the required data type.