Skip to content

Commit

Permalink
Merge pull request #34456 from aaronfranke/its-a-sign
Browse files Browse the repository at this point in the history
[Mono] Make Sign methods consistent with GDScript and System.Math
  • Loading branch information
akien-mga authored Jan 3, 2020
2 parents da62565 + 0b3f1cc commit 529f710
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,14 @@ public static real_t Round(real_t s)

public static int Sign(int s)
{
if (s == 0) return 0;
return s < 0 ? -1 : 1;
}

public static real_t Sign(real_t s)
public static int Sign(real_t s)
{
return s < 0f ? -1f : 1f;
if (s == 0) return 0;
return s < 0 ? -1 : 1;
}

public static real_t Sin(real_t s)
Expand Down

0 comments on commit 529f710

Please sign in to comment.