Hi,
I need help to solve this problem ASAP
it seems that there is overflow of the variable when make this calculation
51569*2=37602 instead of 103138
I think it's overflow because 103138-65536=37602
But the calculation result is store in ULong variable
May be I did something wrong !
Thx for your prompt help
Urgent Variable overflow in calculation
-
- Posts: 200
- http://meble-kuchenne.info.pl
- Joined: Thu Sep 23, 2021 3:44 pm
- Location: France
- Has thanked: 32 times
- Been thanked: 24 times
-
- Matrix Staff
- Posts: 1384
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 184 times
- Been thanked: 322 times
Re: Urgent Variable overflow in calculation
What if you do the following in a calculation icon?
Or alternatively, you could try making the Max_Flow_Var also ULONG instead of a BYTE.
Both of these should force the compiler to perform the calculation without truncating to a UINT.
Code: Select all
Max_Flow_Time = Max_Flow_Const
Max_Flow_Time = Max_Flow_Var * Max_Flow_Time
Both of these should force the compiler to perform the calculation without truncating to a UINT.
-
- Posts: 200
- Joined: Thu Sep 23, 2021 3:44 pm
- Location: France
- Has thanked: 32 times
- Been thanked: 24 times
Re: Urgent Variable overflow in calculation
this work
thx
Code: Select all
Max_Flow_Time = Max_Flow_Const
Max_Flow_Time = Max_Flow_Var * Max_Flow_Time
Seb