diff --git a/doc/langref.html.in b/doc/langref.html.in index 1037be96a7..0a5ff19389 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -827,7 +827,7 @@ a +%= b{#endsyntax#} -
{#syntax#}u32(@maxValue(u32)) +% 1 == 0{#endsyntax#}
+
{#syntax#}u32(std.math.maxInt(u32)) +% 1 == 0{#endsyntax#}
@@ -866,7 +866,7 @@ a -%= b{#endsyntax#} -
{#syntax#}u32(0) -% 1 == @maxValue(u32){#endsyntax#}
+
{#syntax#}u32(0) -% 1 == std.math.maxInt(u32){#endsyntax#}
@@ -901,7 +901,7 @@ a -%= b{#endsyntax#} -
{#syntax#}-%i32(@minValue(i32)) == @minValue(i32){#endsyntax#}
+
{#syntax#}-%i32(std.math.minInt(i32)) == std.math.minInt(i32){#endsyntax#}
@@ -3298,6 +3298,9 @@ const err = (error.{FileNotFound}).FileNotFound; Here is a function to parse a string into a 64-bit integer:

{#code_begin|test#} +const std = @import("std"); +const maxInt = std.math.maxInt; + pub fn parseU64(buf: []const u8, radix: u8) !u64 { var x: u64 = 0; @@ -3327,13 +3330,13 @@ fn charToDigit(c: u8) u8 { '0' ... '9' => c - '0', 'A' ... 'Z' => c - 'A' + 10, 'a' ... 'z' => c - 'a' + 10, - else => @maxValue(u8), + else => maxInt(u8), }; } test "parse u64" { const result = try parseU64("1234", 10); - @import("std").debug.assert(result == 1234); + std.debug.assert(result == 1234); } {#code_end#}

@@ -5539,7 +5542,7 @@ test "main" {

Floored division. Rounds toward negative infinity. For unsigned integers it is the same as {#syntax#}numerator / denominator{#endsyntax#}. Caller guarantees {#syntax#}denominator != 0{#endsyntax#} and - {#syntax#}!(@typeId(T) == builtin.TypeId.Int and T.is_signed and numerator == @minValue(T) and denominator == -1){#endsyntax#}. + {#syntax#}!(@typeId(T) == builtin.TypeId.Int and T.is_signed and numerator == std.math.minInt(T) and denominator == -1){#endsyntax#}.