Fp.opBinary

struct Fp(size_t coefficientSize, Exp = sizediff_t)
nothrow const
opBinary
(
string op : "*"
)
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 a = Fp!128(0, -13, UInt!128.fromHexString("dfbbfae3cd0aff2714a1de7022b0029d"));
auto b = Fp!128(1, 100, UInt!128.fromHexString("e3251bacb112c88b71ad3f85a970a314"));
auto fp = a * b;
assert(fp.sign);
assert(fp.exponent == 100 - 13 + 128);
assert(fp.coefficient == UInt!128.fromHexString("c6841dd302415d785373ab6d93712988"));

Meta