Fp.opCast

  1. T opCast()
  2. T opCast()
  3. T opCast()
    struct Fp(size_t coefficientSize, Exp = sizediff_t)
    nothrow const
    T
    opCast
    (
    T : Fp!newCoefficientSize
    size_t newCoefficientSize
    )
    ()
    if (
    (
    is(Exp == int) ||
    is(Exp == long)
    )
    &&
    coefficientSize % (size_t.sizeof * 8) == 0
    &&
    coefficientSize >= (size_t.sizeof * 8)
    )

Examples

import mir.bignum.fixed: UInt;
auto fp = cast(Fp!64) Fp!128(UInt!128.fromHexString("afbbfae3cd0aff2784a1de7022b0029d"));
assert(fp.exponent == 64);
assert(fp.coefficient == UInt!64.fromHexString("afbbfae3cd0aff28"));

Meta