فهرست منبع

Change behavior of Math::sign to match Godot builtin

Fixes #551.
Erik Abair 4 سال پیش
والد
کامیت
d3f17c1dca
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  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>