gmp Mpz - tadashi9e/gmp4pony GitHub Wiki
mpz_t wrapper class
class ref MpzInitialize to 0 (mpz_init).
new ref create()
: Mpz ref^- Mpz ref^
Initialize and set the value from u (mpz_init_set_ui).
new ref from_u64(
u: U64 val)
: Mpz ref^- u: U64 val
- Mpz ref^
Initialize and set the value from i (mpz_init_set_si).
new ref from_i64(
i: I64 val)
: Mpz ref^- i: I64 val
- Mpz ref^
Initialize and set the value from double (mpz_init_set_d).
new ref from_f64(
double: F64 val)
: Mpz ref^- double: F64 val
- Mpz ref^
Initialize and set the value from mpf (mpz_init & mpz_set_f).
new ref from_mpf(
mpf: Mpf ref)
: Mpz ref^- mpf: Mpf ref
- Mpz ref^
Initialize and set the value from s (mpz_init_set_str).
new ref from_string(
s: String val,
base: I32 val = 10)
: Mpz ref^- Mpz ref^
Get mpz_t pointer.
fun box cpointer()
: Pointer[None val] tagConvert value to I64 (mpz_get_si).
fun box i64()
: I64 val- I64 val
Convert value to U64 (mpz_get_ui).
fun box u64()
: U64 val- U64 val
Convert value to F64 (mpz_get_d).
fun box f64()
: F64 val- F64 val
Format value to string ref (gmp_snprintf).
fun box format(
bufSize: USize val = 100,
pattern: String val = "%Zd",
base: I32 val = 10)
: String ref- String ref
Format value to string val (gmp_snprintf).
fun box string(
bufSize: USize val = 0,
pattern: String val = "%Zd",
base: I32 val = 10)
: String val- String val
Convert value to negative.
fun box neg()
: Mpz ref- Mpz ref
add operattor (mpz_add).
fun box add(
other: Mpz ref)
: Mpz ref- other: Mpz ref
- Mpz ref
sub operattor (mpz_sub).
fun box sub(
other: Mpz ref)
: Mpz ref- other: Mpz ref
- Mpz ref
mul operattor (mpz_mul).
fun box mul(
other: Mpz ref)
: Mpz ref- other: Mpz ref
- Mpz ref
div operattor (mpz_div).
fun box div(
other: Mpz ref)
: Mpz ref- other: Mpz ref
- Mpz ref
eq operator (mpz_cmp).
fun box eq(
other: Mpz ref)
: Bool val- other: Mpz ref
- Bool val
ne operator (mpz_cmp).
fun box ne(
other: Mpz ref)
: Bool val- other: Mpz ref
- Bool val
lt operator (mpz_cmp).
fun box lt(
other: Mpz ref)
: Bool val- other: Mpz ref
- Bool val
le operator (mpz_cmp).
fun box le(
other: Mpz ref)
: Bool val- other: Mpz ref
- Bool val
gt operator (mpz_cmp).
fun box gt(
other: Mpz ref)
: Bool val- other: Mpz ref
- Bool val
ge operator (mpz_cmp).
fun box ge(
other: Mpz ref)
: Bool val- other: Mpz ref
- Bool val