diff --git a/Source/Engine/Core/Math/Mathd.cs b/Source/Engine/Core/Math/Mathd.cs
index cf2c20eb3..f200b8865 100644
--- a/Source/Engine/Core/Math/Mathd.cs
+++ b/Source/Engine/Core/Math/Mathd.cs
@@ -395,7 +395,7 @@ namespace FlaxEngine
///
public static double Sign(double f)
{
- return f < 0d ? -1d : 1d;
+ return f > 0.0d ? 1.0d : f < 0.0d ? -1.0d : 0.0d;
}
///
diff --git a/Source/Engine/Core/Math/Mathf.cs b/Source/Engine/Core/Math/Mathf.cs
index 08ee103c0..b0411133b 100644
--- a/Source/Engine/Core/Math/Mathf.cs
+++ b/Source/Engine/Core/Math/Mathf.cs
@@ -548,7 +548,7 @@ namespace FlaxEngine
///
public static float Sign(float f)
{
- return f < 0f ? -1f : 1f;
+ return f > 0.0f ? 1.0f : f < 0.0f ? -1.0f : 0.0f;
}
///