In the case of integer percentages (represented by steps of 0.01 from 0 to 1) there seem to be some numbers that do not enjoy being stored in a table: when retrieved, they are approximated. If you run the following during a mod's data stage:
Code: Select all
log(0.58)
log(serpent.line({probability = 0.58}))
Code: Select all
1.060 Script @__xxxx.lua:4: 0.58
1.060 Script @__xxxx.lua:5: {probability = 0.57999999999999998}
For gameplay, this difference in probability doesn't matter in the slightest.
What is odd (and has been reported to me as if it were a bug in my mod) is that recipe tooltips round these values up very sensibly for every case except 0.58 - the mod in question has an array of recipes from 2% to 98% in 2% increments (probabilities of 0.02 to 0.98). All of the tooltips are nicely rounded with the exception of 58% (specified as 0.58, represented in the table as 0.57999999999999998), which is shown as 57.99% (see below). The recipes concerned also have a pollution modifier, in this case also specified as 0.58, which is shown correctly as 58%. Numerous other values which are minutely under (0.nn999999999999998) are also shown correctly. I don't know what is special about 58%.