Method on @sym: round (x)

Symbolic round function.

Example:

y = round (sym(-27)/10)
  ⇒ y = (sym) -3

Note that this symbolic function rounds toward even:

round ([sym(5)/2 sym(7)/2])
  ⇒ (sym) [2  4]  (1×2 matrix)

This differs from the builtin numeric function see ‘round’; it corresponds to the builtin Octave function see ‘roundb’.

round ([5/2 7/2])
  ⇒ 3  4
roundb ([5/2 7/2])
  ⇒ 2  4

See also: roundb, @sym/ceil, @sym/floor, @sym/fix, @sym/frac.

Package: symbolic