소스 검색

Merge pull request #1003 from akien-mga/fix-sign-0

Change behavior of Math::sign to match Godot builtin
Rémi Verschelde 2 년 전
부모
커밋
00b29630ba
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      include/godot_cpp/core/math.hpp

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

@@ -561,7 +561,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>