1: #include <petscsys.h> 3: /*@C 4: PetscEqualReal - Returns whether the two `PetscReal` variables are equal 6: Input Parameters: 7: + a - first real number 8: - b - second real number 10: Level: developer 12: Note: 13: Equivalent to "a == b". Should be used to prevent compilers from 14: emitting floating point comparison warnings (e.g. GCC's -Wfloat-equal flag) 15: in PETSc header files or user code. 17: .seealso: `PetscIsCloseAtTol()`, `PetscEqualScalar()` 18: @*/ 19: PetscBool PetscEqualReal(PetscReal a, PetscReal b) 20: { 21: return (a == b) ? PETSC_TRUE : PETSC_FALSE; 22: } 24: /*@C 25: PetscEqualScalar - Returns whether the two `PetscScalar` values are equal. 27: Input Parameters: 28: + a - first scalar value 29: - b - second scalar value 31: Level: developer 33: Note: 34: Equivalent to "a == b". Should be used to prevent compilers from 35: emitting floating point comparison warnings (e.g. GCC's -Wfloat-equal flag) 36: in PETSc header files or user code. 38: .seealso: `PetscIsCloseAtTol()`, `PetscEqualReal()` 39: @*/ 40: PetscBool PetscEqualScalar(PetscScalar a, PetscScalar b) 41: { 42: return (a == b) ? PETSC_TRUE : PETSC_FALSE; 43: }