Method C language for comparing two floating point numbers

C language to compare two floating-point numbers:
C language to compare two floating-point numbers with "==", the return value is completely uncertain. 
Thus only a defined accuracy to determine equality:
IF (FABS (ab &) < 0.0000001 ) {
  // Double type a and b are approximately equal 
}

Guess you like

Origin www.cnblogs.com/ming-4/p/11736105.html