Skip to content

Commit 102b106

Browse files
committed
Fix range obscurity and compile error.
1 parent 5c013d6 commit 102b106

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/std/math/gcd.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ const std = @import("../std.zig");
66
pub fn gcd(a: anytype, b: anytype) @TypeOf(a, b) {
77
const N = switch (@TypeOf(a, b)) {
88
// convert comptime_int to some sized int type for @ctz
9-
comptime_int => std.math.IntFittingRange(@min(a, b), @max(a, b)),
9+
comptime_int => std.math.IntFittingRange(0, @max(a, b)),
1010
else => |T| T,
1111
};
1212

1313
if (@typeInfo(N) != .int or @typeInfo(N).int.signedness != .unsigned) {
14-
@compileError("`a` and `b` must be usigned integers");
14+
@compileError("`a` and `b` must be unsigned integers");
1515
}
1616

1717
// using an optimised form of Stein's algorithm:

0 commit comments

Comments
 (0)