Reprocessing math seems off

i have a quick question (probably somethings i do wrong)

the game tells my reprocessing yelds in minerals so in order to find out how much “rock” one needs in order to get a specific mineral the math should be like this

(Minerals needed / Minerals per Repro run / Repro Yeld) * unit per repro = Rocks to mine

so in a real example assuming we need 1000 units of Mexallon mining Azure Plagioclase

74 Mexallon per repro run, character yield is 66.6% then the math the math would be
(1000/74/0.666) * 100 = 2029

but if that character puts 2029 units into reprocessing, only 985 units come out.
anyone knows how that comes to be?

You get 74 * 0.666 per batch, so 1000 / (74 * 0.666) batches rounded up are necessary.

>>> import math
>>> math.ceil(1000 / (74 * 0.666)) * 100
2100

If you reprocess 2029 units then you’ll get 985 Mexallon and 29 units of Azure Plagioclase will be left over.

1 Like

oh i get it .. the 47 are not reprocessed at all, so its just 2000/100 * 47 wich gets me 1480 * 0.666 = 985(rounded down)

got it .. thanks, now i just need to find some braindead way to note this down for easy practical use :wink:

1 Like

hammered a quick Shell script together as this is really anoying math ;p

that should do it

#!/bin/bash

if [ "$#" -lt 2 ]; then
echo "Usage: $0 MineralsNeeded MineralRatio [CharYeldin%]"
exit 1
fi

mineralsReq=$1
mineralRatio=$2
charYield=${3:-50}

result=$(echo "scale=0; ($mineralsReq / ($mineralRatio * $charYield/100)) + 1" | bc)
final_result=$((result * 100))
echo " "
echo "$final_result Rocks needed for $mineralsReq Minerals (Yiel:d $charYield)"