beautypg.com

HP Prime Graphing Calculator User Manual

Page 425

background image

Functions and commands

419

trunc

Given a value or list of values, as well as an integer n, returns

the value or list truncated to n decimal places. If n is not

provided, it is taken as 0. Accepts complex numbers.

trunc(Real, Integer) or trunc(List, Integer)

Example:

trunc(4.3)

gives

4

tsimplify

Returns an expression with transcendentals rewritten as

complex exponentials.

tsimplify(Expr)

Example:

tsimplify(exp(2*x)+exp(x))

gives

exp(x)^2+exp(x)

type

Returns the type of an expression (e.g. list, string).

type(Expr)

Example:

type("abc")

gives

DOM_STRING

unapply

Returns the function defined by an expression and a variable.

unapply(Expr,Var)

Example:

unapply(2*x^2,x)

gives

(x)→2*x^2

valuation

Returns the valuation (degree of the term of lowest degree) of

a polynomial. With only a polynomial as argument, the

valuation returned is for x. With a variable as second

argument, the valuation is performed for it.

valuation(Poly,[Var])

Example:

valuation(x^4+x^3)

gives

3

variance

Returns the variance of a list or the list of variances of the

columns of a matrix. The optional second list is a list of

weights.

variance(List1, [List2]) or variance(Matrix)

Example:

variance({3, 4, 2}) returns 2/3