From 74ff2b4becb2212ef859f688ea210b38a5bb5b36 Mon Sep 17 00:00:00 2001 From: gram Date: Mon, 20 May 2024 14:58:44 +0200 Subject: [PATCH] rename signum to sign --- tinymath.go | 2 +- tinymath_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tinymath.go b/tinymath.go index f8ec729..4dacc49 100644 --- a/tinymath.go +++ b/tinymath.go @@ -341,7 +341,7 @@ func Round(self float32) float32 { // * `1.0` if the number is positive, `+0.0` or `INFINITY` // * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` // * `NAN` if the number is `NAN` -func Signum(self float32) float32 { +func Sign(self float32) float32 { if IsNaN(self) { return NaN } else { diff --git a/tinymath_test.go b/tinymath_test.go index a8a0ced..38430f1 100644 --- a/tinymath_test.go +++ b/tinymath_test.go @@ -894,7 +894,7 @@ func TestRound(t *testing.T) { } } -func TestSignum(t *testing.T) { +func TestSign(t *testing.T) { t.Parallel() cases := []Case{ {tinymath.Inf, 1.0}, @@ -906,7 +906,7 @@ func TestSignum(t *testing.T) { for _, c := range cases { c := c t.Run(fmt.Sprintf("%f", c.Given), func(t *testing.T) { - act := tinymath.Signum(c.Given) + act := tinymath.Sign(c.Given) eq(t, act, c.Expected) }) }