Skip to content

Commit

Permalink
rename signum to sign
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed May 20, 2024
1 parent 97a0fe7 commit 74ff2b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tinymath.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions tinymath_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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)
})
}
Expand Down

0 comments on commit 74ff2b4

Please sign in to comment.