﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6353	Wrong Integer check and calculations in the 64bit Software.	jens.schoenbohm@…	Martin Sjölund	"I tried to run the following code:

{{{
function test1
  protected
    Integer z = 0;
  algorithm
 
  z := 2147483648; // 2^31
  print(String(z) + ""\n"");
end test1;
}}}

I got the following error:

{{{
[D:/basic_datatypes.mo:34:8-34:18:writable] Warning: OpenModelica (64-bit) only supports 63-bit signed integers! Transforming: 2147483648 into a real
[D:/basic_datatypes.mo:49:8-49:18:writable] Warning: OpenModelica (64-bit) only supports 63-bit signed integers! Transforming: 2147483648 into a real
[D:/basic_datatypes.mo:49:3-49:18:writable] Error: Type mismatch in assignment in z := 2147483648.0 of Integer := Real
[D:/basic_datatypes.mo:49:3-49:18:writable] Error: Type mismatch in pattern z
expression type:
  Real
pattern type:
  Integer
}}}

I also get some funny result with slightly different code:


{{{
function test1
  protected
    Integer z = 0;
  algorithm
 
  z := 2147483647; // 2^31  - 1 largest 32bit int
  z := z + 1;
  print(String(z) + ""\n"");
end test1;
}}}


{{{
Warning: OpenModelica (64-bit) only supports 63-bit signed integers! 
Transforming: 2147483648 into a real -2147483648
}}}


"	defect	closed	high	1.19.0	Run-time	1.16.2	fixed		
