.Buildings.Utilities.Math.Functions.round

Information

Function that outputs the input after rounding it to n digits.

For example,

Hence, the function outputs

    y = floor(x*(10^n) + 0.5)/(10^n)  for  x > 0,
    y = ceil( x*(10^n) - 0.5)/(10^n)  for  x < 0.

To use this function as a block, use Buildings.Controls.OBC.CDL.Reals.Round.

Interface

function round
  extends Modelica.Icons.Function;
  input Real x "Argument to be rounded";
  input Integer n "Number of digits being round to";
  output Real y "Connector of Real output signal";
end round;

Revisions


Generated at 2024-12-04T19:25:49Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos