Opened 13 years ago

Last modified 13 years ago

#1590 closed defect (fixed)

Integers larger than or equal to 2^62 are truncated to 31-bit signed int on 64-bit

Reported by: Per Östlund Owned by: Per Östlund
Priority: high Milestone:
Component: Version:
Keywords: Cc: Per Östlund, Martin Sjölund

Description

Model:

model m
  Integer i = 4611686018427387904 //2^62;
end m;

Message from OMC:

Warning: OpenModelica (64-bit) only supports 63-bit signed integers! Truncating integer: 4611686018427387904 to 1073741823

i should be truncated to 262-1, not 230-1.

Change History (1)

comment:1 by Martin Sjölund, 13 years ago

The problem here is that the RML runtime mk_icon only accepts "int" as input; not long. External functions cannot create long enough integer constants :)

Edit: Used to be this way. Apparently it's changed

Note: See TracTickets for help on using tickets.