Бранимир Караџић il y a 2 ans
Parent
commit
6c2989d95d
3 fichiers modifiés avec 16 ajouts et 16 suppressions
  1. 3 3
      include/bx/inline/math.inl
  2. 2 2
      include/bx/math.h
  3. 11 11
      tests/math_test.cpp

+ 3 - 3
include/bx/inline/math.inl

@@ -138,15 +138,15 @@ namespace bx
 		return float( (0.0f < _a) - (0.0f > _a) );
 		return float( (0.0f < _a) - (0.0f > _a) );
 	}
 	}
 
 
-	inline BX_CONSTEXPR_FUNC bool signbit(float _a)
+	inline BX_CONSTEXPR_FUNC bool signBit(float _a)
 	{
 	{
 		return -0.0f == _a ? 0.0f != _a : 0.0f > _a;
 		return -0.0f == _a ? 0.0f != _a : 0.0f > _a;
 	}
 	}
 
 
-	inline BX_CONSTEXPR_FUNC float copysign(float _value, float _sign)
+	inline BX_CONSTEXPR_FUNC float copySign(float _value, float _sign)
 	{
 	{
 #if BX_COMPILER_MSVC
 #if BX_COMPILER_MSVC
-		return signbit(_value) != signbit(_sign) ? -_value : _value;
+		return signBit(_value) != signBit(_sign) ? -_value : _value;
 #else
 #else
 		return __builtin_copysign(_value, _sign);
 		return __builtin_copysign(_value, _sign);
 #endif // BX_COMPILER_MSVC
 #endif // BX_COMPILER_MSVC

+ 2 - 2
include/bx/math.h

@@ -184,7 +184,7 @@ namespace bx
 	///
 	///
 	/// @returns `true` if `_a` is less than zero, otherwise returns `false`.
 	/// @returns `true` if `_a` is less than zero, otherwise returns `false`.
 	///
 	///
-	BX_CONSTEXPR_FUNC bool signbit(float _a);
+	BX_CONSTEXPR_FUNC bool signBit(float _a);
 
 
 	/// Returns value with the magnitude `_value`, and the sign of `_sign`.
 	/// Returns value with the magnitude `_value`, and the sign of `_sign`.
 	///
 	///
@@ -193,7 +193,7 @@ namespace bx
 	///
 	///
 	/// @returns Value with the magnitude `_value`, and the sign of `_sign`.
 	/// @returns Value with the magnitude `_value`, and the sign of `_sign`.
 	///
 	///
-	BX_CONSTEXPR_FUNC float copysign(float _value, float _sign);
+	BX_CONSTEXPR_FUNC float copySign(float _value, float _sign);
 
 
 	/// Returns the absolute of _a.
 	/// Returns the absolute of _a.
 	///
 	///

+ 11 - 11
tests/math_test.cpp

@@ -556,23 +556,23 @@ TEST_CASE("sign", "[math][libm]")
 	REQUIRE( 1 == bx::sign( bx::kFloatInfinity) );
 	REQUIRE( 1 == bx::sign( bx::kFloatInfinity) );
 }
 }
 
 
-TEST_CASE("signbit", "[math][libm]")
+TEST_CASE("signBit", "[math][libm]")
 {
 {
-	STATIC_REQUIRE( bx::signbit(-0.1389f) );
-	STATIC_REQUIRE(!bx::signbit( 0.0000f) );
-	STATIC_REQUIRE(!bx::signbit( 0.1389f) );
+	STATIC_REQUIRE( bx::signBit(-0.1389f) );
+	STATIC_REQUIRE(!bx::signBit( 0.0000f) );
+	STATIC_REQUIRE(!bx::signBit( 0.1389f) );
 
 
-	REQUIRE( bx::signbit(-bx::kFloatInfinity) );
-	REQUIRE(!bx::signbit( bx::kFloatInfinity) );
+	REQUIRE( bx::signBit(-bx::kFloatInfinity) );
+	REQUIRE(!bx::signBit( bx::kFloatInfinity) );
 }
 }
 
 
-TEST_CASE("copysign", "[math][libm]")
+TEST_CASE("copySign", "[math][libm]")
 {
 {
-	STATIC_REQUIRE( 0.1389f == bx::copysign(-0.1389f, +1389) );
-	STATIC_REQUIRE(-0.0000f == bx::copysign( 0.0000f, -1389) );
-	STATIC_REQUIRE(-0.1389f == bx::copysign( 0.1389f, -1389) );
+	STATIC_REQUIRE( 0.1389f == bx::copySign(-0.1389f, +1389) );
+	STATIC_REQUIRE(-0.0000f == bx::copySign( 0.0000f, -1389) );
+	STATIC_REQUIRE(-0.1389f == bx::copySign( 0.1389f, -1389) );
 
 
-	REQUIRE(-bx::kFloatInfinity == bx::copysign(bx::kFloatInfinity, -1389) );
+	REQUIRE(-bx::kFloatInfinity == bx::copySign(bx::kFloatInfinity, -1389) );
 }
 }
 
 
 TEST_CASE("bitsToFloat, floatToBits, bitsToDouble, doubleToBits", "[math]")
 TEST_CASE("bitsToFloat, floatToBits, bitsToDouble, doubleToBits", "[math]")