Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » operators » not
next | previous | forward | backward | up | index | toc

not -- negation

Description

If x is a boolean, then not x returns true if x is false and vice versa.

i1 : not isPrime 4

o1 = true

If x is a function that returns a boolean, then the return value is also a function.

i2 : isNotPrime = not isPrime

o2 = isNotPrime

o2 : FunctionClosure
i3 : isNotPrime 4

o3 = true
i4 : isNotPrime 5

o4 = false

See also

Ways to use symbol not:

  • not Boolean (missing documentation)
  • not Function (missing documentation)

For the programmer

The object not is a keyword.

This operator may be used as a prefix unary operator in an expression like not y. The user may install a method for handling such expressions with code such as

            not  Y := (y) -> ...

where Y is the class of y.


The source of this document is in Macaulay2Doc/operators.m2:355:0.