gmp

High-level wrapper for GNU Multiple Precision (MP) library.

TODO _ccc Make _ccc two => uint _initCCC and uint _opCCC, mutatingCallCount return their sum. Use these counters to make more precise asserts on how assignments and operators are lowered to calls to C __gmpz-calls

TODO disallow construction and assignment from floating point? Check with other GMP interfaces and std.bigint.

TODO Should in operator be used for anything good?

TODO Support operators << >> >>> &= |= ^=

Members

Aliases

Z
alias Z = MpZ
Undocumented in source.
__mp_limb_t
alias __mp_limb_t = ulong
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
mp_bitcnt_t
alias mp_bitcnt_t = ulong
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
mpz_ptr
alias mpz_ptr = __mpz_struct*
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
mpz_srcptr
alias mpz_srcptr = const(__mpz_struct)*
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Enums

IdentifierStringOfSymbol
eponymoustemplate IdentifierStringOfSymbol(alias sym)
Undocumented in source.
hasMember
eponymoustemplate hasMember(T, string member)
Undocumented in source.
isAbstractClass
eponymoustemplate isAbstractClass(T)
Undocumented in source.
isAbstractFunction
eponymoustemplate isAbstractFunction(alias fn)
Undocumented in source.
isArithmetic
eponymoustemplate isArithmetic(T)

Faster than std.traits. See https://github.com/dlang/phobos/pull/5038

isAssociativeArray
eponymoustemplate isAssociativeArray(T)
Undocumented in source.
isFinalClass
eponymoustemplate isFinalClass(T)
Undocumented in source.
isFinalFunction
eponymoustemplate isFinalFunction(alias fn)
Undocumented in source.
isFloating
eponymoustemplate isFloating(T)
Undocumented in source.
isFloatingPoint
eponymoustemplate isFloatingPoint(T)
Undocumented in source.
isGMPArithmetic
eponymoustemplate isGMPArithmetic(T)

Is true iff T is a GNU MP arithmetic type (long, ulong or double).

isIntegral
eponymoustemplate isIntegral(T)
Undocumented in source.
isLazy
eponymoustemplate isLazy(alias fn)
Undocumented in source.
isLazyMpZExpr
eponymoustemplate isLazyMpZExpr(T)

Is true if type T is lazy (not yet evaluated) MpZ-expression.

isMpZExpr
eponymoustemplate isMpZExpr(T)

Is true if type T can be evaluated to a MpZ value.

isNested
eponymoustemplate isNested(T)
Undocumented in source.
isOut
eponymoustemplate isOut(alias fn)
Undocumented in source.
isOverrideFunction
eponymoustemplate isOverrideFunction(alias fn)
Undocumented in source.
isPOD
eponymoustemplate isPOD(T)
Undocumented in source.
isRef
eponymoustemplate isRef(alias fn)
Undocumented in source.
isScalar
eponymoustemplate isScalar(T)
Undocumented in source.
isScalarType
eponymoustemplate isScalarType(T)
Undocumented in source.
isSigned
eponymoustemplate isSigned(T)
Undocumented in source.
isStaticArray
eponymoustemplate isStaticArray(T)
Undocumented in source.
isStaticFunction
eponymoustemplate isStaticFunction(alias fn)
Undocumented in source.
isTemplate
eponymoustemplate isTemplate(alias sym)
Undocumented in source.
isUnsigned
eponymoustemplate isUnsigned(T)
Undocumented in source.
isVirtualFunction
eponymoustemplate isVirtualFunction(alias fn)
Undocumented in source.
isVirtualMethod
eponymoustemplate isVirtualMethod(alias m)
Undocumented in source.

Functions

__gmpz_abs
void __gmpz_abs(mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_add
void __gmpz_add(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_add_ui
void __gmpz_add_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_addmul
void __gmpz_addmul(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_addmul_ui
void __gmpz_addmul_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_and
void __gmpz_and(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cdiv_q_ui
void __gmpz_cdiv_q_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cdiv_qr_ui
void __gmpz_cdiv_qr_ui(mpz_ptr , mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cdiv_r_ui
ulong __gmpz_cdiv_r_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cdiv_ui
void __gmpz_cdiv_ui(mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_clear
void __gmpz_clear(mpz_ptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cmp
int __gmpz_cmp(mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cmp_d
int __gmpz_cmp_d(mpz_srcptr , double )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cmp_si
int __gmpz_cmp_si(mpz_srcptr , long )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cmp_ui
int __gmpz_cmp_ui(mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cmpabs
int __gmpz_cmpabs(mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cmpabs_d
int __gmpz_cmpabs_d(mpz_srcptr , double )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_cmpabs_ui
int __gmpz_cmpabs_ui(mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_com
void __gmpz_com(mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fdiv_q_ui
void __gmpz_fdiv_q_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fdiv_qr_ui
void __gmpz_fdiv_qr_ui(mpz_ptr , mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fdiv_r_ui
ulong __gmpz_fdiv_r_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fdiv_ui
void __gmpz_fdiv_ui(mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fits_sint_p
int __gmpz_fits_sint_p(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fits_slong_p
int __gmpz_fits_slong_p(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fits_sshort_p
int __gmpz_fits_sshort_p(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fits_uint_p
int __gmpz_fits_uint_p(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fits_ulong_p
int __gmpz_fits_ulong_p(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_fits_ushort_p
int __gmpz_fits_ushort_p(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_gcd
void __gmpz_gcd(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_gcd_ui
ulong __gmpz_gcd_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_get_d
double __gmpz_get_d(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_get_si
long __gmpz_get_si(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_get_str
char* __gmpz_get_str(char* , int , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_get_ui
ulong __gmpz_get_ui(mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_init
void __gmpz_init(mpz_ptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_init_set
void __gmpz_init_set(mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_init_set_d
void __gmpz_init_set_d(mpz_ptr , double )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_init_set_si
void __gmpz_init_set_si(mpz_ptr , long )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_init_set_str
int __gmpz_init_set_str(mpz_ptr , char* , int )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_init_set_ui
void __gmpz_init_set_ui(mpz_ptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_ior
void __gmpz_ior(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_lcm
void __gmpz_lcm(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_lcm_ui
void __gmpz_lcm_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_mod
void __gmpz_mod(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_mul
void __gmpz_mul(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_mul_2exp
void __gmpz_mul_2exp(mpz_ptr , mpz_srcptr , mp_bitcnt_t )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_mul_si
void __gmpz_mul_si(mpz_ptr , mpz_srcptr , long )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_mul_ui
void __gmpz_mul_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_neg
void __gmpz_neg(mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_nextprime
void __gmpz_nextprime(mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_perfect_power_p
void __gmpz_perfect_power_p(mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_pow_ui
void __gmpz_pow_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_powm
void __gmpz_powm(mpz_ptr , mpz_srcptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_powm_ui
void __gmpz_powm_ui(mpz_ptr , mpz_srcptr , ulong , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_root
void __gmpz_root(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_rootrem
void __gmpz_rootrem(mpz_ptr , mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_set
void __gmpz_set(mpz_ptr rop, mpz_srcptr op)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_set_d
void __gmpz_set_d(mpz_ptr rop, double op)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_set_si
void __gmpz_set_si(mpz_ptr rop, long op)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_set_str
int __gmpz_set_str(mpz_ptr , char* , int )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_set_ui
void __gmpz_set_ui(mpz_ptr rop, ulong op)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_sizeinbase
size_t __gmpz_sizeinbase(mpz_srcptr , int )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_sqrt
void __gmpz_sqrt(mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_sqrtrem
void __gmpz_sqrtrem(mpz_ptr , mpz_ptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_sub
void __gmpz_sub(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_sub_ui
void __gmpz_sub_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_swap
void __gmpz_swap(mpz_ptr , mpz_ptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_tdiv_q
void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_tdiv_q_ui
void __gmpz_tdiv_q_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_tdiv_qr_ui
void __gmpz_tdiv_qr_ui(mpz_ptr , mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_tdiv_r
void __gmpz_tdiv_r(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_tdiv_r_ui
ulong __gmpz_tdiv_r_ui(mpz_ptr , mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_tdiv_ui
void __gmpz_tdiv_ui(mpz_srcptr , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_ui_pow_ui
void __gmpz_ui_pow_ui(mpz_ptr , ulong , ulong )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_ui_sub
void __gmpz_ui_sub(mpz_ptr , ulong , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__gmpz_xor
void __gmpz_xor(mpz_ptr , mpz_srcptr , mpz_srcptr )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
_integralAbs
T _integralAbs(T x)

Copied from std.numeric to prevent unnecessary Phobos deps.

abs
MpZ abs(MpZ x)
absUnsign
Unsigned!T absUnsign(MpZ x)
cmpabs
int cmpabs(MpZ x, ulong y)
int cmpabs(MpZ x, double y)
cmpabs
int cmpabs(MpZ x, MpZ y)
gcd
MpZ gcd(MpZ x, ulong y)
gcd
MpZ gcd(MpZ x, MpZ y)
lcm
MpZ lcm(MpZ x, ulong y)
lcm
MpZ lcm(MpZ x, MpZ y)
mpz
MpZ mpz(Args args)

Instantiator for MpZ.

mpzAddExpr
MpzAddExpr!(T1, T2) mpzAddExpr(T1 t1, T2 t2)

Instantiator for MpzAddExpr.

nextPrime
MpZ nextPrime(MpZ x)
powm
MpZ powm(MpZ base, ulong exp, MpZ mod)
powm
MpZ powm(MpZ base, MpZ exp, MpZ mod)
swap
void swap(MpZ x, MpZ y)

Swap contents of x with contents of y.

toDecimalString
string toDecimalString(MpZ x)
toHex
string toHex(MpZ x)

Manifest constants

unittestLong
enum unittestLong;

Call unittests taking long to execute.

Structs

MpZ
struct MpZ

Arbitrary (multi) precision signed integer (Z). Wrapper for GNU MP (GMP)'s type mpz_t and functions mpz_.*.

MpzAddExpr
struct MpzAddExpr(T1, T2)

expression template types MpZ-MpZ adding expression.

MpzDivExpr
struct MpzDivExpr(P, Q)

MpZ-MpZ division expression.

MpzModExpr
struct MpzModExpr(P, Q)

MpZ-MpZ modulus expression.

MpzMulExpr
struct MpzMulExpr(F1, F2)

MpZ-MpZ multiplication expression.

MpzNegExpr
struct MpzNegExpr(A)

MpZ negation expression.

MpzPowMUExpr
struct MpzPowMUExpr(P, Q, M)

MpZ-ulong-MpZ power-modulo expression.

MpzPowUExpr
struct MpzPowUExpr(P, Q)

MpZ-ulong power expression.

MpzSubExpr
struct MpzSubExpr(T1, T2)

MpZ-MpZ subtraction expression.

__mpz_struct
struct __mpz_struct
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Meta