Integer functions
abs
Returns the absolute (non-negative) value of the integer.
to_string
Converts the integer to a string. to_s
is an alias for to_string
.
to_float
Converts the integer to a floating point number. to_f
is an alias for to_float
.
times
Creates a list of integers, starting at 0 and ending with the integer. This function is commonly used to run a for loop, for example:
clamp_zero
Clamps the integer to 0, i.e. negative values become 0.
clamp_one
Clamps the integer to 1, i.e. all values less than 1 become 1.
replace
Replaces matching integer(s) in the number. sub
is an alias for replace
.