ExactArithmetic::CreateFromFactor

Constructs an exact arithmetic context from a custom float-to-int conversion factor

Creates an exact arithmetic based on a provided conversion factor from float to int.

If factor == 1, then this basically allows to pass integers directly (at least the 24 bit afforded by the float mantissa).

Note:
inputs must not be larger than 2^26 / factor.

Signature

class Context:
    // Constructs an exact arithmetic context from a custom float-to-int conversion factor
    fun createExactArithmeticFromFactor(
        factor: float,
        kernel: ArithmeticKernel = Fixed256Pos26,
    ) -> ExactArithmetic