xref: /petsc/src/sys/utils/matheq.c (revision 58d68138c660dfb4e9f5b03334792cd4f2ffd7cc)
1 #include <petscsys.h>
2 
3 /*@C
4     PetscEqualReal - Returns whether the two real values are equal.
5 
6     Input Parameters:
7 +     a - first real number
8 -     b - second real number
9 
10     Notes:
11     Equivalent to "a == b". Should be used to prevent compilers from
12     emitting floating point comparison warnings (e.g. GCC's -Wfloat-equal flag)
13     in PETSc header files or user code.
14 
15     Level: developer
16 @*/
17 PetscBool PetscEqualReal(PetscReal a, PetscReal b) {
18   return (a == b) ? PETSC_TRUE : PETSC_FALSE;
19 }
20 
21 /*@C
22     PetscEqualScalar - Returns whether the two scalar values are equal.
23 
24     Input Parameters:
25 +     a - first scalar value
26 -     b - second scalar value
27 
28     Notes:
29     Equivalent to "a == b". Should be used to prevent compilers from
30     emitting floating point comparison warnings (e.g. GCC's -Wfloat-equal flag)
31     in PETSc header files or user code.
32 
33     Level: developer
34 @*/
35 PetscBool PetscEqualScalar(PetscScalar a, PetscScalar b) {
36   return (a == b) ? PETSC_TRUE : PETSC_FALSE;
37 }
38