Int
This module includes convenience methods for handling int types.
-
RES
let -: (int, int) => intSubtraction of two int values. Same as the subtraction from Pervasives.
Examples
RESopen Belt.Int
2 - 1 == 1
*
RES
let *: (int, int) => intMultiplication of two int values. Same as the multiplication from Pervasives.
Examples
RESopen Belt.Int
2 * 2 == 4
/
RES
let /: (int, int) => intDivision of two int values. Same as the division from Pervasives.
Examples
RESopen Belt.Int
4 / 2 == 2
+
RES
let +: (int, int) => intAddition of two int values. Same as the addition from Pervasives.
Examples
RESopen Belt.Int
2 + 2 == 4
fromFloat
RES
let fromFloat: float => intfromString
RES
let fromString: string => option<int>Converts a given string to an int. Returns Some(int) when the input is a number, None otherwise.
Examples
RESBelt.Int.fromString("1") == Some(1)
toFloat
RES
let toFloat: int => floattoString
RES
let toString: int => string