authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-09-18 10:11:21-07:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-09-18 21:44:56+03:00
log5af5d87ad2227b6a7b5347c7217312ef8a83de12
tree6a6b4384698d449ccf0a46497ba85650f06367d6
parent461036069934c9cbafbc24c5c3acc68e55bde912

std: math.absInt: update docs to use fabs for floats


1 files changed, 1 insertions(+), 0 deletions(-)

lib/std/math.zig+1
......@@ -743,6 +743,7 @@ fn testOverflow() !void {
743743/// Returns the absolute value of x, where x is a value of a signed integer type.
744744/// Does not convert and returns a value of a signed integer type.
745745/// 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.
746747pub fn absInt(x: anytype) !@TypeOf(x) {
747748 const T = @TypeOf(x);
748749 return switch (@typeInfo(T)) {