Category talk:Wren-i64: Difference between revisions
Content added Content deleted
(Added I64.modMul method.) |
(Added U64.modInv method.) |
||
Line 472: | Line 472: | ||
} |
} |
||
return r |
return r |
||
} |
|||
// Returns the multiplicative inverse of 'x' modulo 'n'. |
|||
// The arguments can either be U64 objects or Nums but must be co-prime. |
|||
static modInv(x, n) { |
|||
if (!(x is U64)) x = from(x) |
|||
if (!(n is U64)) n = from(n) |
|||
return I64.modInv(x.toI64, n.toI64).toU64 |
|||
} |
} |
||