Mathcad syntax
The Mathcad notation or Mathcad syntax is used to enter formulas and commands for Mathcad, a commercial mathematical software.
Numbers
Rounding functions
Several functions are available for rounding fractional numeric values to integral values or specifi number of fraction digits:
round(z,n): returns z rounded to n (optional) decimal places. If n is omitted, returns z rounded to the nearest integer (n is assumed to be zero). If n<0, returns z rounded to n places to the left of the decimal point. For example,
-
-
round(π-2πi)returns 3-6i -
round(-(π-2πi))returns -3+6i.
-
trunc(z): returns the integer part of z by removing the fractional part. For example
-
-
trunc(2.7)returns 2 -
trun(-2.7)returns -2
-
floor(z): returns the greatest integer ≤ z
-
-
floor(π-2πi)returns 3-7i -
floor(-(π-2πi))returns -4+6i
-
ceil(z): returns the smallest integer ≥ z
-
-
ceil(π-2πi)returns 4-6i -
ceil(-(π-2πi))returns -3+7i
-