Functions

abs
I

Returns the absolute value of an int value.

fromHexString
I

Returns the integer that a string value represents in hexadecimal.

fromString
I

Returns the integer of a string that represents in decimal.

max
I

Returns the maximum of one or more int values.

min
I

Returns the minimum of one or more int values.

sum
I

Returns sum of zero or more int values.

toHexString
I

Returns representation of an integer as hexdecimal string.

abs

function abs(int n) returns int
Isolated Function

Returns the absolute value of an int value.

Parameters

  • n int
  • int value to be operated on

Return Type

(int)

absolute value of parameter n

fromHexString

function fromHexString(string s) returns int | error
Isolated Function

Returns the integer that a string value represents in hexadecimal.

Both uppercase A-F and lowercase a-f are allowed. It may start with an optional + or - sign. No 0x or 0X prefix is allowed. Returns an error if the parameter s is not in an allowed format.

Parameters

  • s string
  • hexadecimal string representation of int value

Return Type

(int | error)

int value or error

fromString

function fromString(string s) returns int | error
Isolated Function

Returns the integer of a string that represents in decimal.

Returns error if parameter s is not the decimal representation of an integer. The first character may be + or -. This is the inverse of function value:toString applied to an int.

Parameters

  • s string
  • string representation of a integer value

Return Type

(int | error)

int representation of the argument or error

max

function max(int n, int... ns) returns int
Isolated Function

Returns the maximum of one or more int values.

Parameters

  • n int
  • first int value

  • ns int...
  • other int values

Return Type

(int)

maximum value of value of parameter n and all of parameter ns

min

function min(int n, int... ns) returns int
Isolated Function

Returns the minimum of one or more int values.

Parameters

  • n int
  • first int value

  • ns int...
  • other int values

Return Type

(int)

minimum value of parameter n and all of parameter ns

sum

function sum(int... ns) returns int
Isolated Function

Returns sum of zero or more int values.

Parameters

  • ns int...
  • int values to sum

Return Type

(int)

sum of all of parameter ns; 0 if parameter ns is empty

toHexString

function toHexString(int n) returns string
Isolated Function

Returns representation of an integer as hexdecimal string.

There is no 0x prefix. Lowercase letters a-f are used. Negative numbers will have a - prefix. No sign for non-negative numbers.

Parameters

  • n int
  • int value

Return Type

(string)

hexadecimal string representation of int value