aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math.zig
diff options
context:
space:
mode:
authorMeghan Denny <hello@nektro.net>2023-09-18 10:11:21 -0700
committerVeikka Tuominen <git@vexu.eu>2023-09-18 21:44:56 +0300
commit5af5d87ad2227b6a7b5347c7217312ef8a83de12 (patch)
tree6a6b4384698d449ccf0a46497ba85650f06367d6 /lib/std/math.zig
parent461036069934c9cbafbc24c5c3acc68e55bde912 (diff)
downloadzig-5af5d87ad2227b6a7b5347c7217312ef8a83de12.tar.gz
zig-5af5d87ad2227b6a7b5347c7217312ef8a83de12.zip
std: math.absInt: update docs to use fabs for floats
Diffstat (limited to 'lib/std/math.zig')
-rw-r--r--lib/std/math.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/std/math.zig b/lib/std/math.zig
index dccb127c95..7e835059a3 100644
--- a/lib/std/math.zig
+++ b/lib/std/math.zig
@@ -743,6 +743,7 @@ fn testOverflow() !void {
/// Returns the absolute value of x, where x is a value of a signed integer type.
/// Does not convert and returns a value of a signed integer type.
/// Use `absCast` if you want to convert the result and get an unsigned type.
+/// Use `@fabs` if you need the absolute value of a floating point value.
pub fn absInt(x: anytype) !@TypeOf(x) {
const T = @TypeOf(x);
return switch (@typeInfo(T)) {