Page 1 of 1
[Tobias] [2.0.9] Number value input overflow (negative/positive/large/big/combinator/integer) (MR)
Posted: Wed Oct 23, 2024 7:36 pm
by nethus
Hi
when entering too large numbers for output values of a constant combinator, it silently flows over.
on entering i get the following:
1e9: 1.000.000.000
1e10: 1.410.065.408 (shown as 1.4G, probably overflown)
1e11: 1.215.752.192 (shown as 1.2G, probably overflown)
...
The biggest number I am able to enter is: 2.147.483.647
any bigger value flows over to a negative
so I guess that makes sense, as it's overflowing like a 32bit signed integer. However: I'd expect maybe a warning or silently maxing out at 2.147.483.647, instead of silently flowing over to a negative value.
kind regards
Re: [2.0.9] number overflow
Posted: Wed Oct 23, 2024 7:49 pm
by Loewchen
Re: [2.0.9] number overflow
Posted: Wed Oct 23, 2024 8:07 pm
by Genhis
This overflows in user input and the behavior (unintentionally?) changed from 1.1.x, not a duplicate.
Re: [2.0.9] number overflow
Posted: Fri Oct 25, 2024 8:25 pm
by MisterDoctor
This occurs also for the minimum value of a logistics request. It is also possible to just enter negative values or other expressions that evaluate to negative values. For the maximum value of a logistics request it is not possible to enter an expression. When entering a negative minimum, the value is accepted and the request is saved with a negative minimum. I'm not 100% sure if negative minimums for logistics requests are valid or not but I don't think they are. I first noticed this by trying to enter very large values and noticed that the value 1e12 results in something like -727M.
Re: [2.0.9] Number value input overflow (negative/positive/large/big/combinator/integer) (MR)
Posted: Mon Nov 11, 2024 10:00 pm
by robot256
Oh that's fun. [2.0.16] When you set a logistic requester chest to "Max = 0", "Min = -50G", it does a flying text with the error message "Min (1539....) must be <= Max (0)" because the negative number clearly got converted to a positive for the error checking. However, the text on the item still says "-50G" until I close and reopen the chest GUI, after which it says "0" for both max and min. If I put in a normal negative number like "-100", there is no error message and it stays that way after reopening the GUI.
Re: [2.0.9] Number value input overflow (negative/positive/large/big/combinator/integer) (MR)
Posted: Wed Nov 13, 2024 1:28 am
by HeliGungir
This has been really bugging me. Large numbers are clamped, rather than overflow, in other parts of the UI, like constants in arithmetic combinators and constants in the conditions to enable/disable machines. And I do use this to set the max or min int32 without having to remember the actual values are specifically 2147483647 and -2147483648.
But then there's constant combinators, which use logistic groups, which don't clamp large numbers and instead sign overflow.