Actual source code: matheq.c

  1: #include <petscsys.h>

  3: /*@C
  4:     PetscEqualReal - Returns whether the two real values are equal.

  6:     Input Parameters:
  7: +     a - first real number
  8: -     b - second real number

 10:     Note:
 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.

 15:     Level: developer

 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 scalar values are equal.

 27:     Input Parameters:
 28: +     a - first scalar value
 29: -     b - second scalar value

 31:     Note:
 32:     Equivalent to "a == b". Should be used to prevent compilers from
 33:     emitting floating point comparison warnings (e.g. GCC's -Wfloat-equal flag)
 34:     in PETSc header files or user code.

 36:     Level: developer

 38: .seealso: `PetscIsCloseAtTol()`, `PetscEqualReal()`
 39: @*/
 40: PetscBool PetscEqualScalar(PetscScalar a, PetscScalar b)
 41: {
 42:   return (a == b) ? PETSC_TRUE : PETSC_FALSE;
 43: }