#bug? glitch? error in the code?

1 messages · Page 1 of 1 (latest)

final latch
#

it started when constellation reached x54.700000000001, then didnt revert back to the regular ×54.7 after restarting the game

is this a bug? if it isnt, can someone explain why it happened? i play with a lot of scaling jokers but this was the first time i encountered something like this ever.

#

bug? glitch? error in the code?

old prism
#

This is a common bug in games called a floating point error, where you get so high that the decimal place gets slightlyy wrong

#

Im not 100% knowledgeable on the topic but thats my superficial understanding

#

An example is boats in minecraft, where if you fall from certain heights your pixels will slightly clip into the ground causing the boat to break and you to die

simple shadow
#

It's also called a double rounding error (I think. I know it's that with calculators giving for example ⅓ as .333333333334 and not .33 repeating)

potent folio
#

Basically, binary numbers in computers can only have so many digits, and some numbers could never be represented accurately in binary. Attempting to represent a number like 0.1 is achieved by effectively estimating the value of 0.1 as a sum of powers of 2. For example, with 8 digits of binary, estimating 0.1 would give you (in improper notation) 0.00011001 which is actually 0.09765625 in decimal. Now if we expand the number of digits to something like 64, the estimation becomes significantly more accurate but still incorrect. Typically, any error is accounted for by rounding numbers to the lowest significant value, recognizing that these inaccuracies exist. You won’t ever see this bug occur with an xmult scaler like hologram since 0.25 is 2^-2, which can be represented as 0.01 in binary as a finite number and is entirely accurate without more digits being added.

old prism
#

Thank you for the explanation

#

I feel smert now

potent folio
#

I’m trying to stay in the range of what I know. Honestly I have no clue why exactly constellation is choosing to do this.💀

hard junco
#

how did a floating point precision error even happen here??

potent folio
#

Okay I figured it out. Basically, constellation scales by adding 0.1 to 1 each time a planet card is used. It just so happens that adding .1 expressed in 64 bit binary 537 times results in an error significant enough to be rounded to 54.700000000001. This means that we could potentially see that last decimal number tick to a 2 with enough planet cards.
So it’s not an issue with 54.7 itself. It’s an issue with the sum of every slightly inaccurate 0.1.
Edit: I think the bits allocated to representing the summed 54 actually help push it slightly to round as they are added.