SHIP:Sail:Numeric Functions

From Serious Documentation
Jump to: navigation, search
Function Returns Introduced Description
abs Integer/Float v4.0 Gets the absolute value of a number
argb Color v5.1.0 Creates a combined color from separate color channels.
atod Double v5.1.0 Parses a String to get a Double from it
atof Float v5.0.120 Parses a String to get an Float from it
atoi Integer v5.0.120 Parses a String to get an Integer from it
atol Long v5.1.0 Parses a String to get an Long from it
bytesToString String v5.0.207 Builds a string from the ASCII bytes of an Integer, Short, or Byte until a 0x00 byte is encountered or the number of bytes of the size of the object are consumed. Optionally, non-printable characters can be replaced as-encountered. All byte orderings are supported.
ceil Integer v5.0 Gets the smallest integer greater than or equal to a number
codepointToString String v4.0 Returns a single character string for the specified Unicode-16 codepoint. If the Codepoint is invalid, the string is empty.
dtof Integer v5.1.0 Explicitly casts an Double to a Float
dtoi Integer v5.0 Casts a Double to an Integer
dtol Long v5.1.0 Casts a Double to a Long
exp Float v5.1.0 Return e to the given power
expm1 Float v5.1.0 Return e to the given power minus 1
floor Integer v5.0 Gets the largest integer less than or equal to a number
ftod Integer v5.1.0 Explicitly casts an Float to a Double
ftoi Integer v5.0 Casts a Float to an Integer
ftol Long v5.1.0 Casts a Float to a Long
indexOf Integer v4.0 Returns the index of the first found occurrence (if any) of a substring within another string, optionally starting at a specified offset. If the substring is not found, -1 is returned.
itod Double v5.1.0 Explicitly casts an Integer to a Double
itof Integer v5.0 Explicitly casts an Integer to a Float
itol Integer v5.0 Explicitly casts an Integer to a Long
lastIndexOf Integer v4.0 Returns the index of the last found occurrence (if any) of a substring within another string, optionally starting at a specified offset. If the substring is not found, -1 is returned.
length Integer v2.0 Returns the length in characters (not bytes) of a string.
log Float v5.1.0 Return the natural log of a number
log10 Float v5.1.0 Return the base 10 log of a number
log1p Float v5.1.0 Return the natural log of a number + 1
ltod Long v5.1.0 Explicitly casts a Long to a Double
ltof Long v5.1.0 Explicitly casts a Long to a Float
ltoi Integer v5.1.0 Explicitly casts a Long to an Integer
mapRange Integer v5.1.0 Maps a number from range A to range B.
mapSteinhartHart Float v5.0.131 Calculates the precise temperature of a thermister.
max Integer/Float v4.0 Gets the maximum value of two or more numbers
min Integer/Float v4.0 Gets the minimum value of two or more numbers
neg Integer/Float v5.1.0 Return the negative of the given number
pow Float v5.1.0 Calculates x to the power of y (x^y)
random Integer v5.1.0 Generate a pseudo random number
round Integer v5.0 Gets the nearest integer to a number
sqrt Float v5.1.0 Calculates the square root of a number (√n)
toDegrees Float v5.1.0 Convert radians to degrees
toRadians Float v5.1.0 Convert degrees to radians
toString String v2.0 Converts an Integer or Float to a string. Options include leading 0 padding, radix, and precision.
towards Float/Integer v5.0.207 Adjusts a number by a percentage in a range towards another number

See Also: