Skip to main content
Ctrl+K
PETSc 3.26.0 documentation - Home
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • PetscIsCloseAtTol

PetscIsCloseAtTol#

Returns whether the two PetscReal numbers are close at a given relative and absolute tolerances https://www.python.org/dev/peps/pep-0485/.

Synopsis#

PetscBool PetscIsCloseAtTol(PetscReal a, PetscReal b, PetscReal rtol, PetscReal atol)

Input Parameters#

  • a - first floating point number

  • b - second floating point number

  • rtol - relative tolerance

  • atol - absolute tolerances

See Also#

PetscIsCloseAtTolScalar(), PetscEqualReal(), PetscEqualScalar()

Level#

beginner

Location#

src/sys/utils/mathclose.c

Examples#

src/sys/tests/ex39.c
src/mat/tests/ex261.c
src/ts/event/tests/ex3span.c
src/ts/tests/ex29.c
src/vec/vec/tests/ex28.c
src/vec/vec/tests/ex31.c
src/vec/vec/tests/ex37.c
src/vec/vec/tests/ex63.c
src/vec/vec/tests/ex64.c


Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

On this page
  • Synopsis
  • Input Parameters
  • See Also
  • Level
  • Location
  • Examples
Edit on GitLab
Show Source

© Copyright 1991-2026, UChicago Argonne, LLC and the PETSc Development Team.

Created using Sphinx 7.3.7.

Built with the PyData Sphinx Theme 0.15.1.

Last updated on 2026-09-28T23:34:57-0500 (v3.26.0).