Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » BasicList » Expression » value(Expression)
next | previous | forward | backward | up | index | toc

# value(Expression) -- evaluate

- Function: value

## Description

Expressions can be evaluated using value.

    i1 : QQ[x];

    i2 : f = (x+1)^5

          5     4      3      2
    o2 = x  + 5x  + 10x  + 10x  + 5x + 1

    o2 : QQ[x]

    i3 : e = expression f

          5     4      3      2
    o3 = x  + 5x  + 10x  + 10x  + 5x + 1

    o3 : Expression of class Sum

    i4 : value e

          5     4      3      2
    o4 = x  + 5x  + 10x  + 10x  + 5x + 1

    o4 : QQ[x]

    i5 : value e == f

    o5 = true

    i6 : c = factor f

                5
    o6 = (x + 1)

    o6 : Expression of class Product

    i7 : value c

          5     4      3      2
    o7 = x  + 5x  + 10x  + 10x  + 5x + 1

    o7 : QQ[x]

## Ways to use this method:

- value(Expression) -- evaluate

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