Skip to main content

Utility Functions

normalize

Maps the integer value to the range [0, 1].

fun normalize(_ value: Int, min: Int, max: Int) -> (Float)

denormalize

Maps the normalized value to the closest integer value in the range [min, max].

fun denormalize(_ value: Float, min: Int, max: Int) -> (Int)