pub fn fromPrimitive(comptime T: type, x: T) (InvalidModulusError || OverflowError)!Self T: typex: T460
461
462
463
464 pub fn fromPrimitive(comptime T: type, x: T) (InvalidModulusError || OverflowError)!Self {
comptime assert(@bitSizeOf(T) <= max_bits); // Primitive type is larger than the modulus type.
const v = try FeUint.fromPrimitive(T, x);
return try Self.fromUint(v);
}
Creates a new modulus from a primitive value. The modulus must be odd and larger than 2.