gmp Mpf - tadashi9e/gmp4pony GitHub Wiki

Mpf

[Source]

mpf_t wrapper class

class ref Mpf

Constructors

create

[Source]

Initialize to 0 (mpf_init).

new ref create()
: Mpf ref^

Returns


from_u64

[Source]

Initialize and set the value from u (mpf_init_set_ui).

new ref from_u64(
  u: U64 val)
: Mpf ref^

Parameters

Returns


from_i64

[Source]

Initialize and set the value from i (mpf_init_set_si).

new ref from_i64(
  i: I64 val)
: Mpf ref^

Parameters

Returns


from_f64

[Source]

Initialize and set the value from double (mpf_init_set_d).

new ref from_f64(
  double: F64 val)
: Mpf ref^

Parameters

  • double: F64 val

Returns


from_mpz

[Source]

Initialize and set the value from mpz (mpf_init & mpf_set_z).

new ref from_mpz(
  mpz: Mpz ref)
: Mpf ref^

Parameters

Returns


from_string

[Source]

Initialize and set the value from s (mpf_init_set_str).

new ref from_string(
  s: String val,
  base: I32 val = 10)
: Mpf ref^

Parameters

Returns


Public Functions

cpointer

[Source]

Get mpf_t pointer.

fun box cpointer()
: Pointer[None val] tag

Returns


i64

[Source]

Convert value to I64 (mpf_get_si).

fun box i64()
: I64 val

Returns


u64

[Source]

Convert value to U64 (mpf_get_ui).

fun box u64()
: U64 val

Returns


f64

[Source]

Convert value to F64 (mpf_get_d).

fun box f64()
: F64 val

Returns


format

[Source]

Format value to string ref (gmp_snprintf).

fun box format(
  bufSize: USize val = 100,
  pattern: String val = "%Ff",
  base: I32 val = 10)
: String ref

Parameters

  • bufSize: USize val = 100
  • pattern: String val = "%Ff"
  • base: I32 val = 10

Returns


string

[Source]

Format value to string val (gmp_snprintf).

fun box string(
  bufSize: USize val = 100,
  pattern: String val = "%Ff",
  base: I32 val = 10)
: String val

Parameters

  • bufSize: USize val = 100
  • pattern: String val = "%Ff"
  • base: I32 val = 10

Returns


neg

[Source]

Convert value to negative.

fun box neg()
: Mpf ref

Returns


add

[Source]

add operattor (mpf_add).

fun box add(
  other: Mpf ref)
: Mpf ref

Parameters

  • other: Mpf ref

Returns


sub

[Source]

sub operattor (mpf_sub).

fun box sub(
  other: Mpf ref)
: Mpf ref

Parameters

  • other: Mpf ref

Returns


mul

[Source]

mul operattor (mpf_mul).

fun box mul(
  other: Mpf ref)
: Mpf ref

Parameters

  • other: Mpf ref

Returns


div

[Source]

div operattor (mpf_div).

fun box div(
  other: Mpf ref)
: Mpf ref

Parameters

  • other: Mpf ref

Returns


sqrt

[Source]

Returns square root of value (mpf_sqrt).

fun box sqrt()
: Mpf ref

Returns


eq

[Source]

eq operator (mpf_cmp).

fun box eq(
  other: Mpf ref)
: Bool val

Parameters

  • other: Mpf ref

Returns


ne

[Source]

ne operator (mpf_cmp).

fun box ne(
  other: Mpf ref)
: Bool val

Parameters

  • other: Mpf ref

Returns


lt

[Source]

lt operator (mpf_cmp).

fun box lt(
  other: Mpf ref)
: Bool val

Parameters

  • other: Mpf ref

Returns


le

[Source]

le operator (mpf_cmp).

fun box le(
  other: Mpf ref)
: Bool val

Parameters

  • other: Mpf ref

Returns


gt

[Source]

gt operator (mpf_cmp).

fun box gt(
  other: Mpf ref)
: Bool val

Parameters

  • other: Mpf ref

Returns


ge

[Source]

Ge operator (mpf_cmp).

fun box ge(
  other: Mpf ref)
: Bool val

Parameters

  • other: Mpf ref

Returns


⚠️ **GitHub.com Fallback** ⚠️