pub fn mul(comptime T: type, a: T, b: T) (error T: typea: Tb: T560
561
562
563
564
565pub fn mul(comptime T: type, a: T, b: T) (error{Overflow}!T) {
if (T == comptime_int) return a * b;
const ov = @mulWithOverflow(a, b);
if (ov[1] != 0) return error.Overflow;
return ov[0];
}
Returns the product of a and b. Returns an error on overflow.