sixhotdogneck
Well-Known Member
- Joined
- Jul 16, 2018
- Messages
- 172
- Reaction score
- 39
Randomize()
pH = Round((5.6 - 5.2) * Rnd() + 5.2, 2)
pH = Round((5.6 - 5.2) * Rnd() + 5.2, 2)
Unless your compiler is smart enough to do it for you that should be simplified to pH = Round(0.4 * Rnd() + 5.2, 2) in order to speed up execution.
Well when do you suppose I did most of my coding?
Well when do you suppose I did most of my coding?
Yes, I guess so but I'm still groping.Don't worry bud, I can tell by the code in your spreadsheet that you're getting better at VBA using advanced features, etc...
H-H is the key to the approach for sure but my current strategy is to not explain it at all. The plan is to try to convince people that if they mix a volume of water containing m1 mmoles of bicarbonate, w kg of some malt to it and mLac mmoles of lactic acid all they have to do is find pH that reducesYou have an interesting implementation of Henderson-Hasselbalch. It may be beneficial to some to expand some of that code making it more clear to others what is happening.
Sure but habit dies hard. I still code polynomials as (((d*x + c)*x + b)*x + a.The speed of current computers and the ability of modern compilers rarely justified writing cryptic code.
As was my reply.The OP was just a bad tech joke, I guess.
I thought that was probably true but that was before this Voltmeter spreadsheet got to where it is today. I'm back to looking desperately for ways to save a cycle or two like passing by value, writing polynomials as (((d*x + c)*x + b)*x + a, looking for indications I can get out of a loop faster etc.The speed of current computers and the ability of modern compilers rarely justified writing cryptic code.
I thought that was probably true but that was before this Voltmeter spreadsheet got to where it is today. I'm back to looking desperately for ways to save a cycle or two like passing by value, writing polynomials as (((d*x + c)*x + b)*x + a, looking for indications I can get out of a loop faster etc.
Nope. On this machine (Mac Mini) it takes 4.5719 seconds to evaluate 1 + 2*arg + 3*arg^2 + 4*arg^3 + 5*arg^4 + 6*arg^5 + 7*arg^6 + 8*arg^7 ten million times but only 1.99501 seconds to evaluate ((((((8*arg + 7)*arg +6)*arg + 5)*arg + 4)*arg + 3)*arg + 2)*arg + 1 (which gives the same result) ten million times. Thus the first coding takes 2.29 times longer!I seriously hope you're being facetious.
I think you had better read up on your Debye-Hückle.Read up on your Graph Theory.
Enter your email address to join: