Function Precision(x, y)

Precision

Precision(
     x,            ! (input) numerical expression
     y             ! (input) integer expression
     )

Arguments

x

A scalar numerical expression.

y

An integer expression.

Return Value

The function Precision returns x rounded to y significant digits.

Note

  • The function Precision can be used in constraints of nonlinear mathematical programs. However, nonlinear solvers may experience convergence problems around the discontinuities of the Precision function.

  • When the numerical expression contains a unit, the function Precision will first convert the expression to the corresponding base unit, before evaluating the function itself.

See also

The functions Round, Ceil, Floor, Trunc. Arithmetic functions are discussed in full detail in Arithmetic Functions of the Language Reference.