#Not whole numbers for upgrade cards
1 messages · Page 1 of 1 (latest)
Reported multiple times, known bug
haha... I don't know how you managed to get something to give you a non-integer that but I can say they're stored internally as a double, so its not completely surprising to see it show a non-integer, just nothing should be modifying them except as an integer
Huh, why is it better to store them as a double rather than an int? Just curious
I'm not sure I'd say its better, but its the way they've been stored in the game since forever ago. If I were to rewrite that system I would probably store them as an uint16 or uint32 since the counts are unlikely to ever get ludicrously huge (uint8 is too small). However, we also store a bunch of other numbers including the various currencies in the same thing so its just easier to use a double for everything for now. Plus double can exactly represent all int32 values
Ok, fair
If the currencies are stored in the same thing, it sounds a lot easier to store this as a double too
I was gonna post a bug report for this but you already did. Anyways here are my pics of it lol.
do either of you know how to reproduce the issue? ( Also I've filed a copy of this bug as CELL-1835 )
Not at all but it won't go away even days later
it's just stuck this way
also Idk if it would work but maybe if the game recognizes a non-integer card, as a temporary work around it just forces it to the closest integer?
Can you send me a DM? for troubleshoot.
sure
Hmmmm lol
Sent this to a friend and he sent this back https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems
In computing, floating-point arithmetic (FP) is arithmetic that represents subsets of real numbers using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base.
Numbers of this form are called floating-point numbers.: 3 : 10
For example, 12.345 is a floating-point number in base ten with five di...
I don't understand it though 0_0
WHATDAFUG
IDFK MAN