Mathematical constants

(directly go to documentation on : Infinity, Pi, Undefined, GoldenRatio, Catalan, gamma. )

# 26. Mathematical constants

Infinity | constant representing mathematical infinity
Pi | mathematical constant, pi
Undefined | constant signifying an undefined result
GoldenRatio | the Golden Ratio
Catalan | Catalan's Constant
gamma | Euler's constant gamma

###

Infinity -- constant representing mathematical infinity

##### Standard library

##### Calling format:

    Infinity

##### Description:

Infinity represents infinitely large values. It can be the result of certain calculations.

Note that for most analytic functions Yacas understands `Infinity` as a positive number. Thus `Infinity*2` will return `Infinity`, and `a < Infinity` will evaluate to `True`.

##### Examples:

    In> 2*Infinity
    Out> Infinity;
    In> 2<Infinity
    Out> True;

###

Pi -- mathematical constant, pi

##### Standard library

##### Calling format:

    Pi

##### Description:

Pi symbolically represents the exact value of pi. When the `N()` function is used, `Pi` evaluates to a numerical value according to the current precision. It is better to use `Pi` than `N(Pi)` except in numerical calculations, because exact simplification will be possible.

This is a "cached constant" which is recalculated only when precision is increased.

##### Examples:

    In> Sin(3*Pi/2)
    Out> -1;
    In> Pi+1
    Out> Pi+1;
    In> N(Pi)
    Out> 3.14159265358979323846;

##### See also:

Sin , Cos , N , CachedConstant .

###

Undefined -- constant signifying an undefined result

##### Standard library

##### Calling format:

    Undefined

##### Description:

`Undefined` is a token that can be returned by a function when it considers its input to be invalid or when no meaningful answer can be given. The result is then "undefined".

Most functions also return `Undefined` when evaluated on it.

##### Examples:

    In> 2*Infinity
    Out> Infinity;
    In> 0*Infinity
    Out> Undefined;
    In> Sin(Infinity);
    Out> Undefined;
    In> Undefined+2*Exp(Undefined);
    Out> Undefined;

##### See also:

Infinity .

###

GoldenRatio -- the Golden Ratio

##### Standard library

##### Calling format:

    GoldenRatio

##### Description:

These functions compute the "golden ratio"

phi<=>1.6180339887<=>(1+Sqrt(5))/2.

The ancient Greeks defined the "golden ratio" as follows: If one divides a length 1 into two pieces x and 1-x, such that the ratio of 1 to x is the same as the ratio of x to 1-x, then 1/x<=>1.618... is the "golden ratio".

The constant is available symbolically as `GoldenRatio` or numerically through `N(GoldenRatio)`. This is a "cached constant" which is recalculated only when precision is increased. The numerical value of the constant can also be obtained as `N(GoldenRatio)`.

##### Examples:

    In> x:=GoldenRatio - 1
    Out> GoldenRatio-1;
    In> N(x)
    Out> 0.6180339887;
    In> N(1/GoldenRatio)
    Out> 0.6180339887;
    In> V(N(GoldenRatio,20));

    CachedConstant: Info: constant GoldenRatio is
    being recalculated at precision 20
    Out> 1.6180339887498948482;

##### See also:

N , CachedConstant .

###

Catalan -- Catalan's Constant

##### Standard library

##### Calling format:

    Catalan

##### Description:

These functions compute Catalan's Constant Catalan<=>0.9159655941.

The constant is available symbolically as `Catalan` or numerically through `N(Catalan)` with `N(...)` the usual operator used to try to coerce an expression in to a numeric approximation of that expression. This is a "cached constant" which is recalculated only when precision is increased. The numerical value of the constant can also be obtained as `N(Catalan)`. The low-level numerical computations are performed by the routine `CatalanConstNum`.

##### Examples:

    In> N(Catalan)
    Out> 0.9159655941;
    In> DirichletBeta(2)
    Out> Catalan;
    In> V(N(Catalan,20))

    CachedConstant: Info: constant Catalan is
    being recalculated at precision 20
    Out> 0.91596559417721901505;

##### See also:

N , CachedConstant .

###

gamma -- Euler's constant gamma

##### Standard library

##### Calling format:

    gamma

##### Description:

These functions compute Euler's constant gamma<=>0.57722...

The constant is available symbolically as `gamma` or numerically through using the usual function `N(...)` to get a numeric result, `N(gamma)`. This is a "cached constant" which is recalculated only when precision is increased. The numerical value of the constant can also be obtained as `N(gamma)`. The low-level numerical computations are performed by the routine `GammaConstNum`.

Note that Euler's Gamma function Gamma(x) is the capitalized `Gamma` in Yacas.

##### Examples:

    In> gamma+Pi
    Out> gamma+Pi;
    In> N(gamma+Pi)
    Out> 3.7188083184;
    In> V(N(gamma,20))

    CachedConstant: Info: constant gamma is being
      recalculated at precision 20
    GammaConstNum: Info: used 56 iterations at
      working precision 24
    Out> 0.57721566490153286061;

##### See also:

Gamma , N , CachedConstant .