Hello,
VAR outR: UDINT; END_VAR
outR:=1024/255255100/100;
Why outR = 1020 but not 1024?
see this ..could help https://www.mathsisfun.com/operation-order-bodmas.html m
I studied math at school. Unfortunately the operations order doesn't mater here. I believe the problem somewhere in data types.
I find out the problem: 255 is not a 256 and all calculations was done in integer type.
Log in to post a comment.
Hello,
VAR
outR: UDINT;
END_VAR
outR:=1024/255255100/100;
Why outR = 1020 but not 1024?
see this ..could help
https://www.mathsisfun.com/operation-order-bodmas.html m
I studied math at school.
Unfortunately the operations order doesn't mater here. I believe the problem somewhere in data types.
I find out the problem: 255 is not a 256 and all calculations was done in integer type.