[2.0.43] Odd rounding effects in assembly machine crafting speed display

Bugs that are actually features.
Ralfinator
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Sun Jun 26, 2016 9:37 pm
Contact:

[2.0.43] Odd rounding effects in assembly machine crafting speed display

Post by Ralfinator »

I have filled a cryogenic plant to the brim with legendary productivity module 3, and selected the promethium science pack as the recipe. I would expect that this results in an output of 2.4/s, as confirmed by FactorioLab, but instead I get:
04-13-2025, 22-41-24.png
04-13-2025, 22-41-24.png (17.55 KiB) Viewed 264 times
The numbers for the input are also off -- that should be "0.8", "0.08", and "2", respectively.

Is this just a visual glitch or will this actually run ever so slightly too slow?
Rseding91
Factorio Staff
Factorio Staff
Posts: 15879
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.43] Odd rounding effects in assembly machine crafting speed display

Post by Rseding91 »

Thanks for the report. This is simply how floating point numbers work. After all the math is done, what an infinite fraction system would say ends up as “2” may end up 1.999999998 and when showing the numbers as strings it shows only one decimal place.
If you want to get ahold of me I'm almost always on Discord.
Ralfinator
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Sun Jun 26, 2016 9:37 pm
Contact:

Re: [2.0.43] Odd rounding effects in assembly machine crafting speed display

Post by Ralfinator »

Thanks for the reply!

Rounding 1.99999998 to a precision of 2 decimals for display would still end up with 2.0. So it seems to me that either no such rounding happens (just a simple truncation of the string), or the result here would be more like 2.3949999999 which seems surprisingly inaccurate?
Post Reply

Return to “Not a bug”