Skip to main content
`Ctrl`+`K`

# PetscAbs

Returns the absolute value of a number

## Synopsis

    #include <petscmath.h>
    type PetscAbs(type v)

Not Collective

## Input Parameter

- v - the number

## Note

The type can be integer or real floating point value, but cannot be complex

## See Also

`PetscAbsInt()`, `PetscAbsReal()`, `PetscAbsScalar()`, `PetscSign()`

## Level

beginner

## Location

include/petscmath.h

## Examples

src/ksp/ksp/tutorials/ex42.c
src/snes/tutorials/ex56.c
src/ksp/ksp/tutorials/ex49.c
src/ts/tutorials/ex9.c
src/ksp/ksp/tutorials/ex43.c
src/snes/tutorials/ex77.c

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