PetscSign#

Returns the sign of a number as an integer of value -1, 0, or 1

Synopsis#

#include <petscmath.h>
int PetscSign(type v)

Not Collective

Input Parameter#

  • v - the number

Note#

The type can be integer or real floating point value

See Also#

PetscAbsInt(), PetscAbsReal(), PetscAbsScalar()

Level#

beginner

Location#

include/petscmath.h

Examples#

src/ts/tutorials/ex44.c
src/ts/utils/dmplexlandau/tutorials/ex1.c


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