arithmetic combinator bug

Bugs that are actually features.
craig_g
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Jul 18, 2017 11:53 pm
Contact:

arithmetic combinator bug

Post by craig_g »

The arithmetic combinator cant multiply properly. It can multiply properly with other ores from what I cant test, just seem to get this behaviour for copper.
It works for some numbers but not others strangely enough.

The number seems to roll into the negative without reason. Picture below says it all.
Attachments
proof
proof
cant multiply copper.jpg (965.43 KiB) Viewed 2269 times
craig_g
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Jul 18, 2017 11:53 pm
Contact:

Re: arithmetic combinator bug

Post by craig_g »

running version 0.15.30
Alfred0110
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon May 29, 2017 3:05 pm
Contact:

Re: arithmetic combinator bug

Post by Alfred0110 »

This is caused by integer overflow - if the result of an operation exceeds the range of a 32-bit integer (about 2.15 billion) it will wrap around and become negative.
craig_g
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Jul 18, 2017 11:53 pm
Contact:

Re: arithmetic combinator bug

Post by craig_g »

Now I know the problem I have put in a work around.
Thanks :)
Post Reply

Return to “Not a bug”