Fix c# math sign functions for #993

This commit is contained in:
Chandler Cox
2023-04-14 09:31:49 -05:00
parent 4bdeb26e74
commit 685a68b7b8
2 changed files with 2 additions and 2 deletions

View File

@@ -395,7 +395,7 @@ namespace FlaxEngine
/// <param name="f"></param>
public static double Sign(double f)
{
return f < 0d ? -1d : 1d;
return f > 0.0d ? 1.0d : f < 0.0d ? -1.0d : 0.0d;
}
/// <summary>

View File

@@ -548,7 +548,7 @@ namespace FlaxEngine
/// <param name="f"></param>
public static float Sign(float f)
{
return f < 0f ? -1f : 1f;
return f > 0.0f ? 1.0f : f < 0.0f ? -1.0f : 0.0f;
}
/// <summary>