.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-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos