:orphan:
# KSPGetResidualNorm
Gets the last (possibly approximate and/or preconditioned) residual norm that has been computed.
## Synopsis
```
#include "petscksp.h"
PetscErrorCode KSPGetResidualNorm(KSP ksp, PetscReal *rnorm)
```
Not Collective
## Input Parameter
- ***ksp -*** the iterative context
## Output Parameter
- ***rnorm -*** residual norm
## Note
For some methods, such as `KSPGMRES`, the norm is not computed directly from the residual.
The type of norm used by the method can be controlled with `KSPSetNormType()`
## See Also
[](ch_ksp), `KSP`, `KSPSetNormType()`, `KSPBuildResidual()`, `KSPNormType`
## Level
intermediate
## Location
src/ksp/ksp/interface/iterativ.c
## Examples
src/ksp/ksp/tutorials/ex10.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/iterativ.c)
[Index of all KSP routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)