Constants¶
Yacas-specific constants¶
-
% previous result
%evaluates to the previous result on the command line.%is a global variable that is bound to the previous result from the command line. Using%will evaluate the previous result. (This uses the functionality offered by the {SetGlobalLazyVariable} command).Typical examples are
Simplify(%)andPrettyForm(%)to simplify and show the result in a nice form respectively.- Example
In> Taylor(x,0,5)Sin(x) Out> x-x^3/6+x^5/120; In> PrettyForm(%) 3 5 x x x - -- + --- 6 120See also
-
EndOfFile¶ end-of-file marker
End of file marker when reading from file. If a file contains the expression {EndOfFile;} the operation will stop reading the file at that point.
Mathematical constants¶
-
True¶ -
False¶ boolean constants representing true and false
TrueandFalseare typically a result of boolean expressions such as2 < 3orTrue And False.
See also
And(), Or(), Not()
-
Infinity¶ constant representing mathematical infinity
Infinityrepresents infinitely large values. It can be the result of certain calculations.Note that for most analytic functions yacas understands
Infinityas a positive number. ThusInfinity*2will returnInfinity, anda < Infinitywill evaluate toTrue.- Example
In> 2*Infinity Out> Infinity; In> 2<Infinity Out> True;
-
Pi¶ mathematical constant, \(\pi\)
The constant represents the number π. It is available symbolically as
Pior numerically throughN(Pi).This is a cached constant which is recalculated only when precision is increased.
- Example
In> Sin(3*Pi/2) Out> -1; In> Pi+1 Out> Pi+1; In> N(Pi) Out> 3.14159265358979323846;
See also
-
Undefined¶ constant signifying an undefined result
Undefinedis 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
Undefinedwhen evaluated on it.- Example
In> 2*Infinity Out> Infinity; In> 0*Infinity Out> Undefined; In> Sin(Infinity); Out> Undefined; In> Undefined+2*Exp(Undefined); Out> Undefined;
See also
-
GoldenRatio¶ the golden ratio
The constant represents the golden ratio
\[\phi := \frac{1+\sqrt{5}}{2} = 1.6180339887\ldots\]It is available symbolically as
GoldenRatioor numerically throughN(GoldenRatio).This is a cached constant which is recalculated only when precision is increased.
- Example
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
-
Catalan¶ Catalan’s constant
The constant represents the Catalan’s constant
\[G := \beta(2) = \sum_{n=0}^\infty\frac{-1^n}{(2n+1)^2}=0.9159655941\ldots\]It is available symbolically as
Catalanor numerically throughN(Catalan).This is a cached constant which is recalculated only when precision is increased.
- Example
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
-
gamma¶ Euler–Mascheroni constant \(\gamma\)
The constant represents the Euler–Mascheroni constant
\[\gamma := \lim_{n\to\infty}\left(-\ln(n)+\sum_{k=1}^n\frac{1}{k}\right)=0.5772156649\ldots\]It is available symbolically as
gammaor numerically throughN(gamma).This is a cached constant which is recalculated only when precision is increased.
Note
Euler’s \(\Gamma(x)\) function is the capitalized
Gamma()in yacas.- Example
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