Browse Source

Change behavior of Math::sign to match Godot builtin

Fixes #551.
Erik Abair 4 years ago
parent
commit
d3f17c1dca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/godot_cpp/core/math.hpp

+ 1 - 1
include/godot_cpp/core/math.hpp

@@ -433,7 +433,7 @@ inline T max(T a, T b) {
 
 template <typename T>
 inline T sign(T x) {
-	return static_cast<T>(x < 0 ? -1 : 1);
+	return static_cast<T>(SIGN(x));
 }
 
 template <typename T>