# PetscCompl
Expands to the integer complement of its argument 
## Synopsis
```
#include <petscmacros.h>
int PetscCompl(b)
```

## Input Parameter

- ***b -*** Preprocessor variable, must expand to either integer literal 0 or 1



## Output Parameter

- ***<return-*** value> - Either integer literal 0 or 1



## Notes
Not available from Fortran.

Expands to integer literal 0 if b expands to 1, or integer literal 1 if b expands to
0. Behaviour is undefined if b expands to anything else. PetscCompl() will expand its
argument before returning the complement.

This macro can be useful for negating PetscDefined() inside macros e.g.

```none
#define PETSC_DONT_HAVE_FOO PetscCompl(PetscDefined(HAVE_FOO))
```


## Example usage
```none
  #define MY_VAR 1
  PetscCompl(MY_VAR) -> 0

  #undef  MY_VAR
  #define MY_VAR 0
  PetscCompl(MY_VAR) -> 1
```





## See Also
 `PetscConcat()`, `PetscDefined()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscmacros.h.html#PetscCompl">include/petscmacros.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscmacros.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
