Skip to content

Instantly share code, notes, and snippets.

@thorade
Last active December 24, 2015 07:29
Show Gist options
  • Save thorade/6763767 to your computer and use it in GitHub Desktop.
Save thorade/6763767 to your computer and use it in GitHub Desktop.
Modelica function that checks whether the (Real) input may be treated as an integer
function isInteger
"returns true if input u is an Integer, else false"
input Real u;
output Boolean y;
algorithm
y := if abs(u-integer(u))<Modelica.Constants.small then true else false;
end isInteger;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment