MathCompareByDigits

지정된 유효 자릿수까지 두 숫자가 같은지 비교합니다.

bool MathCompareByDigits(
 const double value1// 첫 번째 숫자
 const double value2// 두 번째 숫자
 const int digits // 유효 자릿수
 );
 
bool MathCompareByDigits(
 const float value1// 첫 번째 숫자
 const float value2// 두 번째 숫자
 const int digits // 유효 자릿수
 );
 
bool MathCompareByDigits(
 const complex value1// 첫 번째 숫자
 const complex value2// 두 번째 숫자
 const int digits // 유효 자릿수
 );
 
bool MathCompareByDigits(
 const complexf value1// 첫 번째 숫자
 const complexf value2// 두 번째 숫자
 const int digits // 유효 자릿수
 );

매개변수

value1

[in] 비교할 첫 번째 숫자.

value2

[in] 비교할 두 번째 숫자.

digits

[in] 비교할 유효 자릿수.

반환값

비교한 숫자가 digits 유효 자릿수까지 일치하면 true를 반환합니다. 그렇지 않으면 false를 반환합니다.

참고

이 함수는 비교할 숫자의 크기 차수를 미리 알 수 없는 경우와, 실수부와 허수부의 크기 차수가 크게 다를 수 있는 복소수에 유용합니다. 그 밖의 경우에는 epsilon 기반 비교를 사용하는 것이 좋습니다.

값 중 하나가 0이면 비교가 수행되지 않습니다. 이 경우 epsilon 기반 비교를 사용하십시오. 복소수의 경우 실수부와 허수부를 쌍으로 비교합니다.