﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5063	[NF] Variability of integer() result	Adrian Pop	Per Östlund	"The Modelica spec is not clear if integer() function returns a discrete time result. Seems to be a hint about it in the formulation.

{{{

integer(x)
returns the largest integer not greater than x. 
The argument shall have type Real. The result has 
type Integer. 
[Note, outside of a when-clause state events are 
 triggered when the return value changes discontinuously]

}}}

This model:
{{{#!mo
function r
  input Integer x;
  output Integer y;
algorithm
 y := integer(x);
end r;

model X
  Real x;
  Integer z;
  parameter Integer p = 2;
equation
  z = r(x=integer(x) + p);
  der(x) = -2 * x;
end X;
}}}

This gets you with NF:

{{{
adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting/nf
$ time ~/dev/OpenModelica/build/bin/omc +d=newInst integer.mo
Error processing file: integer.mo
[C:/home/adrpo33/dev/OMTesting/nf/integer.mo:16:3-16:26:writable] Error: Function argument x=integer(x) + p in call r with variability continuous is not a discrete expression.
}}}

We calculate the variability of the component based on the prefixes and the type {{{Integer}}} gives you implicit discrete variability.

This issue plagues AdvancedNoise library.
"	defect	closed	high	2.0.0	New Instantiation		fixed		
