Skip to content

Overflow error while reading integers

Reading a too large integer from the input file overflows. This can lead to difficult to debug model errors. Considering an input file with

set: const real x = 42107077259;
remark: "x", x;

the output will be

line 2, file <implicit_conversions>: "x", -8.42596e+08

because 42107077259 is first read and assigned to an integer variable, that overflows to -842595701, and later on stored into a real variable. Test case: implicit_conversions

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information