From f3426ef69188b981e9f183aa9b32ca6a7a7b393f Mon Sep 17 00:00:00 2001 From: kayomn Date: Tue, 1 Nov 2022 15:07:40 +0000 Subject: [PATCH] Change maxInt to return a comptime_int --- src/core/math.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/math.zig b/src/core/math.zig index e6f9959..6cb3c23 100644 --- a/src/core/math.zig +++ b/src/core/math.zig @@ -4,7 +4,7 @@ pub const IntFittingRange = @import("std").math.IntFittingRange; /// /// Returns the maximum value of `Integer`. /// -pub fn maxInt(comptime Integer: type) Integer { +pub fn maxInt(comptime Integer: type) comptime_int { return switch (@typeInfo(Integer)) { .Int => |info| if (info.bits == 0) 0 else ((1 << (info.bits - @boolToInt(info.signedness == .signed))) - 1),