Skip to main content

multiply

Function multiply 

Source
pub fn multiply<S: Semiring>(a: S, b: S) -> S
Expand description

Multiplies two values.

Free function version that dispatches to Semiring::multiply.

§Type Signature

forall S. Semiring S => (S, S) -> S

§Type Parameters

  • S: The semiring type.

§Parameters

  • a: The first value.
  • b: The second value.

§Returns

The product of the two values.

§Examples

use fp_library::classes::semiring::multiply;

assert_eq!(multiply(2i32, 3), 6);