.. highlightlang:: us .. index:: fround .. _fround: fround ====== .. us.tag fround ENGLISH New5110 math-base :ref:`fround` rounds the elements of a matrix. The number of significant digits can be specified. .. function:: rmRound = fround(rmMat) rmRound = fround(rmMat, nPrec) rmRound = fround(rmMat, nPrec, bSignificant) rmRound = fround(rmMat, nPrec, bSignificant, ssOption) .. us.return **Return Value** *rmRound* is a real matrix. .. us.params **Parameters** .. uparam:: rmMat *rmMat* is a real matrix. .. uparam:: nPrec *nPrec* is a number in the range -15 to 15. Default value is 2. If *bSignificant* is FALSE (0) or not specified *nPrec* specifies the number of decimals. If *nPrec* is smaller than 0, *nPrec* sets the position left of the decimal point. If *bSignificant* is TRUE (1) the absolute value of *nPrec* specifies the number of significant places. .. uparam:: bSignificant *bSignificant* specifies the meaning of *nPrec*. The default value is FALSE (0). .. list-table:: :header-rows: 0 * - TRUE - *nPrec* specifies the number of significant places * - FALSE - *nPrec* specifies the number of decimals (default) .. uparam:: ssOption *ssOption* specifies the rounding method, if the digit behind the significant digit is a 5 and all following digits are zeros. Default value is "even". .. list-table:: :header-rows: 0 * - "even" - 1.5 => 2, 2.5 => 2, 3.5 => 4 (Banker's Rounding) * - "odd" - 1.5 => 1 * - "up" - 1.5 => 2 * - "down" - 1.5 => 1 * - "rand" - 1.5 => 1 oder 2 (random). .. us.example **Example** :: * fround(7.045) 7.0400 * fround(7.045, 2, FALSE, "even") 7.0400 * fround(1997, 3, TRUE) 2000.0000 * fround(0.12345, 4, TRUE, "up") 0.1235 * fround(0.12345, 3, TRUE, "up") 0.1230 * fround(0.12345, 4, TRUE, "up") 0.1235 * fround(0.12345, 4, TRUE, "even") 0.1234 * fround(0.12355, 4, TRUE, "even") 0.1236 * fround(0.12355, 4, TRUE, "down") 0.1235 * fround(0.12305, 4, TRUE, "down") 0.1230 * fround(0.12355, 4, TRUE, "down") 0.1235 .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.11.0 - New. .. seealso:: :ref:`overview-mathematic`, :ref:`int`, :ref:`ceil`, :ref:`floor` :sub:`id-2044751`