In wallet.cpp, around lines 125, 129 and 237 there are some calculations to find the nDeriveIterations necessary for a given PC.
pMasterKey.second.nDeriveIterations = pMasterKey.second.nDeriveIterations * (100 / ((double)(GetTimeMillis() - nStartTime)));
pMasterKey.second.nDeriveIterations = (pMasterKey.second.nDeriveIterations + pMasterKey.second.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
kMasterKey.nDeriveIterations = (kMasterKey.nDeriveIterations + kMasterKey.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
Now, I'm not secure secure of it, but I'll say that the first has a better order of operations. Why?
Now, nDeriveIterations is an uint. The first one multiplies it by a double number (100 / ...). There won't be an overflow at this point. Then the double is downcasted to uint (and here there could be an overflow). The second and third variants first multiply the uint by 100 and then (through the division with a double) convert it to a double. By first multiplying it by 100 you have limited the nDeriveIterations to around 42 million. Yeah, I do know that this isn't important with today computers :-)