-
Notifications
You must be signed in to change notification settings - Fork 12
/
big_int.gleam
31 lines (23 loc) · 935 Bytes
/
big_int.gleam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pub type BigInt
/// `+` operation
@external(javascript, "../../big_int_ffi.mjs", "add")
pub fn add(a: BigInt, b: BigInt) -> BigInt
/// `*` operation
@external(javascript, "../../big_int_ffi.mjs", "multiply")
pub fn multiply(a: BigInt, b: BigInt) -> BigInt
/// `-` operation
@external(javascript, "../../big_int_ffi.mjs", "subtract")
pub fn subtract(a: BigInt, b: BigInt) -> BigInt
/// `%` operation
@external(javascript, "../../big_int_ffi.mjs", "modulo")
pub fn modulo(a: BigInt, b: BigInt) -> BigInt
/// `**` operation
@external(javascript, "../../big_int_ffi.mjs", "power")
pub fn power(a: BigInt, b: BigInt) -> BigInt
/// `/` operation
@external(javascript, "../../big_int_ffi.mjs", "divide")
pub fn divide(a: BigInt, b: BigInt) -> BigInt
@external(javascript, "../../big_int_ffi.mjs", "from")
pub fn from_int(a: Int) -> BigInt
@external(javascript, "../../big_int_ffi.mjs", "from")
pub fn from_string(a: String) -> BigInt