Skip to main content

agentchat.contrib.captainagent.tools.math.modular_inverse_sum

modular_inverse_sum

def modular_inverse_sum(expressions, modulus)

Calculates the sum of modular inverses of the given expressions modulo the specified modulus.

Arguments:

  • expressions list - A list of numbers for which the modular inverses need to be calculated.
  • modulus int - The modulus value.

Returns:

  • int - The sum of modular inverses modulo the specified modulus.