From de820009346c0b2c3c09bf6b823bd5bd154f55f7 Mon Sep 17 00:00:00 2001 From: milarin Date: Mon, 24 Apr 2023 14:53:55 +0200 Subject: [PATCH] added Abs --- math.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/math.go b/math.go index a55939d..f2860f5 100644 --- a/math.go +++ b/math.go @@ -5,3 +5,7 @@ import "math" func Pow[N Number](x, y N) N { return N(math.Pow(float64(x), float64(y))) } + +func Abs[N Number](v N) N { + return N(math.Abs(float64(v))) +}