dkh.int128

64bit op 64bit -> 128bit, library(mul, div, divmod)

  • Declaration

    ulong[2] mul128(ulong a, ulong b);

    a * b = (return[1]<<64) + return[0]

  • Declaration

    ulong div128(ulong[2] a, ulong b);

    [a[1], a[0]] / b = return, 答えが64bitに収まらないとヤバイ

  • Declaration

    ulong mod128(ulong[2] a, ulong b);

    [a[1], a[0]] % b = return, 答えが64bitに収まらないとヤバイ