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