Skip to main content
`Ctrl`+`K`

# PetscAbsScalar

Returns the absolute value (magnitude) of a `PetscScalar` value, as a `PetscReal`

## Synopsis

    #include <petscmath.h>
    PetscReal PetscAbsScalar(PetscScalar a)

Not Collective; No Fortran Support

## Input Parameter

. a - the value

## See Also

`PetscReal`, `PetscScalar`, `PetscComplex`

## Level

beginner

## Location

include/petscmath.h

## Examples

src/snes/tutorials/ex8.c
src/ts/tutorials/ex30.c
src/snes/tutorials/ex15.c
src/ts/tutorials/ex53.c
src/dm/tutorials/ex2.c
src/ts/tutorials/ex9.c
src/snes/tutorials/ex69.c
src/snes/tutorials/ex75.c

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