BigIntView.opCast

  1. T opCast()
  2. T opCast()
  3. T opCast()
    struct BigIntView(W, WordEndian endian = TargetEndian)
    scope const
    T
    opCast
    (
    T : Fp!coefficientSize
    size_t internalRoundLastBits = 0
    bool wordNormalized = false
    bool nonZero = false
    size_t coefficientSize
    )
    ()
    if (
    internalRoundLastBits < size_t.sizeof * 8 &&
    (
    size_t.sizeof >= W.sizeof ||
    endian == TargetEndian
    )
    )
    if (
    is(Unqual!W == ubyte) ||
    is(Unqual!W == ushort)
    ||
    is(Unqual!W == uint)
    ||
    is(Unqual!W == ulong)
    )
  4. BigIntView!V opCast()

Examples

import mir.bignum.fixed: UInt;
import mir.bignum.fp: Fp;

auto fp = cast(Fp!128) BigIntView!size_t.fromHexString("-afbbfae3cd0aff2714a1de7022b0029d");
assert(fp.sign);
assert(fp.exponent == 0);
assert(fp.coefficient == UInt!128.fromHexString("afbbfae3cd0aff2714a1de7022b0029d"));

Meta