Merge pull request #34456 from aaronfranke/its-a-sign

[Mono] Make Sign methods consistent with GDScript and System.Math
This commit is contained in:
Rémi Verschelde 2020-01-03 11:16:44 +01:00 committed by GitHub
commit 529f710ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -266,12 +266,14 @@ namespace Godot
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)