| ... | @@ -743,6 +743,7 @@ fn testOverflow() !void { | ... | @@ -743,6 +743,7 @@ fn testOverflow() !void { |
| 743 | /// Returns the absolute value of x, where x is a value of a signed integer type. | 743 | /// Returns the absolute value of x, where x is a value of a signed integer type. |
| 744 | /// Does not convert and returns a value of a signed integer type. | 744 | /// Does not convert and returns a value of a signed integer type. |
| 745 | /// Use `absCast` if you want to convert the result and get an unsigned type. | 745 | /// Use `absCast` if you want to convert the result and get an unsigned type. |
| | 746 | /// Use `@fabs` if you need the absolute value of a floating point value. |
| 746 | pub fn absInt(x: anytype) !@TypeOf(x) { | 747 | pub fn absInt(x: anytype) !@TypeOf(x) { |
| 747 | const T = @TypeOf(x); | 748 | const T = @TypeOf(x); |
| 748 | return switch (@typeInfo(T)) { | 749 | return switch (@typeInfo(T)) { |