Int
Index
Bound
Codec
Comparator
Constructor
Formatting
Indexable
Numeric
Type
Other
Bound
readonlymaxValue
Maximum value for this type
readonlyminValue
Minimum value for this type
Codec
__decode__
Returns the decoded
input,Result.OkorResult.Error()
__encode__
Returns the encoded
input
__schema__
Returns the JSONSchema corresponding to the decoded type
Comparator
!=
"Not equal to" operator
<
"Less than" operator
<=
"Less than or equal to" operator
==
"Equal to" operator
>
"Greater than" operator
>=
"Greater than or equal to" operator
clamp
Clamp value between minValue and maxValue
compare
Return an Ordering that represents comparison result
equals
Alias to '=='
max
"maximum" operator
min
"minimum" operator
Constructor
fromNumber
Return a new integer from
value
Formatting
asString
Converts the given value to a String.
Indexable
indexType
Index type
at
Returns the value at the index
indexOf
Returns the integer index of a value
range
Returns an Iterable starting from
starttoend. Ifstartorendis not in range then returns an empty iterable.
rangeSize
Returns the size of a range. If
startorendis not in range then returns 0.
Numeric
%
Remainder operator
*
Multiplication operator
**
Power operator
+
Addition operator
-
Subtraction operator
/?
Division operator
abs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == x
isNegative
Returns true if the number is negative and false if the number is zero or positive.
isPositive
Returns true if the number is positive and false if the number is zero or negative.
isZero
Returns true if self is equal to the additive identity.
negate
Negates the given value.
sign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == x
zero
Returns the additive identity element of
T, 0.
Type
__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
asInstance
Try to convert anyValue to enum value or else returns
Option.None
hasInstance
Return
trueif the given value is an instance of the class.
unwrap
Convert a tagged value to the underlying type
wrap
Convert an underlying type to a tagged type
Other
typeName
Module
Type parameters
- T: number
readonlymaxValue
Maximum value for this type
readonlyminValue
Minimum value for this type
!=
"Not equal to" operator
%
Remainder operator
*
Multiplication operator
**
Power operator
+
Addition operator
-
Subtraction operator
/?
Division operator
<
"Less than" operator
<=
"Less than or equal to" operator
==
"Equal to" operator
>
"Greater than" operator
>=
"Greater than or equal to" operator
abs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == x
clamp
Clamp value between minValue and maxValue
compare
Return an Ordering that represents comparison result
equals
Alias to '=='
isNegative
Returns true if the number is negative and false if the number is zero or positive.
isPositive
Returns true if the number is positive and false if the number is zero or negative.
isZero
Returns true if self is equal to the additive identity.
max
"maximum" operator
min
"minimum" operator
negate
Negates the given value.
sign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == x
zero
Returns the additive identity element of
T, 0.
Make
Create a module
numbertypeType parameters
- T: number
__call__
format
Return string representation of integer
parse
Parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems). If the
expressionis not valid, it returnsOption.None
A collection of functions to manipulate integer values