[0.14.14] Solar panel module power doesn't add up properly

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
User avatar
Align
Fast Inserter
Fast Inserter
Posts: 214
Joined: Sun Aug 10, 2014 5:17 pm
Contact:

[0.14.14] Solar panel module power doesn't add up properly

Post by Align »

Each panel produces 10 kW, so 7 should produce 70, but you get 69.9 instead.
Image

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4944
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.14.14] Solar panel module power doesn't add up properly

Post by Klonan »

Thanks for the report,

I can reproduce the rounding issue:


Rseding91
Factorio Staff
Factorio Staff
Posts: 11930
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.14.14] Solar panel module power doesn't add up properly

Post by Rseding91 »

Ahh floating point numbers :)

Solar panels actually don't produce 10 KW. They produce some finite number *just* below 10 KW but the conversion to a string doesn't care when the number is that small so it shows 10. As you add together several of the *just below* 10 KW values the gap increases and the conversion to string shows that they don't actually produce that much.

It's similar to the fluid issue where 4999.999999 fluid is not technically 5000 fluid but converting it to a string as 4.9k is off by a wide margin so it would get rounded to 5k.

Basically what I'm saying is: there's no simple fix :P
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Minor issues”