JCM0165
asked on
problem with math.log function in vb.net
I am not sure if I am using the math.log function in vb.net properly.
I am trying to do the formula
%Fat=495/(1.0324-0.19077(l og(waist-n eck))+0.15 456(log(he ight)))-45 0
(and converting inches to cm)
with
LbJP.Text = 495 / (1.0324 - 0.19077 * (Math.Log((Val(TxtWaistBL. Text) * 2.54) - (Val(TxtNeck.Text) * 2.54))) + 0.15456 * (Math.Log((Val(TxtHeight.T ext) * 2.54)))) - 450
but the number isn't coming out anywhere near close to where it should.
High points for expediency! I need an answer quickly
I am trying to do the formula
%Fat=495/(1.0324-0.19077(l
(and converting inches to cm)
with
LbJP.Text = 495 / (1.0324 - 0.19077 * (Math.Log((Val(TxtWaistBL.
but the number isn't coming out anywhere near close to where it should.
High points for expediency! I need an answer quickly
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Make sure the bracketing around the logs is in the right place.
The important thing is that:
Log10(X) = Math.Log(X) / Math.Log(10)
The important thing is that:
Log10(X) = Math.Log(X) / Math.Log(10)
ASKER
Thanks!
To convert to base 10 log, you need to divide by the natural log of 10.
Open in new window