import mir.bignum.fp: Fp; import mir.bignum.fixed: UInt; auto fp = cast(Fp!128) BigUIntView!ulong.fromHexString("afbbfae3cd0aff2714a1de7022b0029d"); assert(fp.exponent == 0); assert(fp.coefficient == UInt!128.fromHexString("afbbfae3cd0aff2714a1de7022b0029d")); fp = cast(Fp!128) BigUIntView!uint.fromHexString("ae3cd0aff2714a1de7022b0029d"); assert(fp.exponent == -20); assert(fp.coefficient == UInt!128.fromHexString("ae3cd0aff2714a1de7022b0029d00000")); fp = cast(Fp!128) BigUIntView!ushort.fromHexString("e7022b0029d"); assert(fp.exponent == -84); assert(fp.coefficient == UInt!128.fromHexString("e7022b0029d000000000000000000000")); fp = cast(Fp!128) BigUIntView!ubyte.fromHexString("e7022b0029d"); assert(fp.exponent == -84); assert(fp.coefficient == UInt!128.fromHexString("e7022b0029d000000000000000000000")); fp = cast(Fp!128) BigUIntView!size_t.fromHexString("e7022b0029d"); assert(fp.exponent == -84); assert(fp.coefficient == UInt!128.fromHexString("e7022b0029d000000000000000000000")); fp = cast(Fp!128) BigUIntView!size_t.fromHexString("ffffffffffffffffffffffffffffffff1000000000000000"); assert(fp.exponent == 64); assert(fp.coefficient == UInt!128.fromHexString("ffffffffffffffffffffffffffffffff")); fp = cast(Fp!128) BigUIntView!size_t.fromHexString("ffffffffffffffffffffffffffffffff8000000000000000"); assert(fp.exponent == 65); assert(fp.coefficient == UInt!128.fromHexString("80000000000000000000000000000000")); fp = cast(Fp!128) BigUIntView!size_t.fromHexString("fffffffffffffffffffffffffffffffe8000000000000000"); assert(fp.exponent == 64); assert(fp.coefficient == UInt!128.fromHexString("fffffffffffffffffffffffffffffffe")); fp = cast(Fp!128) BigUIntView!size_t.fromHexString("fffffffffffffffffffffffffffffffe8000000000000001"); assert(fp.exponent == 64); assert(fp.coefficient == UInt!128.fromHexString("ffffffffffffffffffffffffffffffff"));