Max/min values of int

Max/min values of int

jeremy_r
Not applicable
2 Views
2 Replies
Message 1 of 3

Max/min values of int

jeremy_r
Not applicable

[ FlexSim 18.2.0 ]

In one particular application, I would like to check the value I want to assign to ensure if falls within the appropriate range for an int, so that it doesn't over or underflow.

While I can see that these values are defined in the documentation (-2147483647 and 2147483647), is there a better way to obtain this value in my code than hardcoding it (or defining it in a global macro)? For example, is there some function like int.max that will return the maximum value an int can hold (such that if the max/min values were to change in a later version of FlexSim, these would contain the new values)?

0 Likes
Accepted solutions (1)
3 Views
2 Replies
Replies (2)
Message 2 of 3

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

INT_MAX is a global fsmacro. You can look yourself in the main tree

project + exec + globals + fsmacros

Message 3 of 3

jeremy_r
Not applicable

Thanks, this is what I was looking for!

0 Likes