Macaulay2 » Documentation
Packages » Macaulay2Doc » analytic functions » Constant » isConstant
next | previous | forward | backward | up | index | toc

# isConstant -- whether a ring element is constant

- Usage:
    `isConstant f`
- Inputs:
  - f
- Outputs:
  - whether f is constant, i.e., is in the coefficient ring

## Description

    i1 : isConstant 3

    o1 = true

    i2 : QQ[a,b][x,y];

    i3 : isConstant (x+a-x)

    o3 = true

    i4 : isConstant x

    o4 = false

## Code

    ../../m2/rings.m2:102:26-102:66: --source code:
    isConstant RingElement := r -> liftable(r, coefficientRing ring r)

## See also

- coefficientRing -- get the coefficient ring

## Ways to use isConstant:

- `isConstant(RingElement)`

## For the programmer

The object isConstant is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/doc_arithmetic.m2:182:0.