Additional basic functions.
Swaps the elements in a pair.
swap ( 1, 2 ) == ( 2, 1 )The maximum safe value for an integer, defined as 2^53 - 1. Anything
larger than that and behaviour becomes mathematically unsound.
(maxSafeInteger + 1) == (maxSafeInteger + 2)
== TrueThe minimum safe value for an integer, defined as -(2^53 - 1). Anything
smaller than that, and behaviour becomes mathematically unsound.
(minSafeInteger - 1) == (minSafeInteger - 2)
== TrueChecks if a given integer is within the safe range, meaning it is between
-(2^53 - 1) and 2^53 - 1.
isSafeInteger 5 == True
isSafeInteger maxSafeInteger == True
isSafeInteger (maxSafeInteger + 1) == FalsePerform modular arithmetic involving floating point numbers.
The sign of the result is the same as the sign of the modulus
(the m in fmod x m).
fmod 5 2 == 1
fmod 5 2.5 == 0
fmod 4.5 2 == 0.5
fmod -5 2 == 1
fmod -4.5 2 == 1.5
fmod 5 -2 == -1
fmod 4.5 -2 == -1.5Convert standard Elm angles (radians) to degrees.
inDegrees (turns 2) == 720
inDegrees pi == 180Convert standard Elm angles (radians) to radians.
inRadians (degrees 90) == pi / 2
inRadians (turns 1) == 2 * piConvert standard Elm angles (radians) to turns. One turn is equal to 360°.
inTurns (degrees 180) == 0.5
inTurns (3 * pi) = 1.5
A shorthand for writing 2-tuples. Very commonly used when expressing key/value pairs in CSS or Json encoders.