PDA

Click to See Complete Forum and Search --> : Log (base10) conversion - VB6


Steve Cain
Sep 3rd, 2001, 05:10 AM
I need to create a couple of functions in VB. One to return the log(10) of a number and one to do the reverse, convert the ani-log back again.

If anyone can help would be much appreciated.

Thanks.

fbokker
Sep 3rd, 2001, 05:20 AM
ok, here's how to calculate log10 from natural log

Log10 = Log(value) / Log(10)

the opposite way around:

10^value

beachbum
Sep 3rd, 2001, 05:27 AM
Damn beat me! :p :D

Private Sub Command1_Click()
x = 100000
Label1 = Log(x) / Log(10)

y = Val(Label1.Caption)
Label2 = 10 ^ y
End Sub

Steve Cain
Sep 3rd, 2001, 05:30 AM
Thanks to all.

Regards,

kedaman
Sep 3rd, 2001, 09:22 AM
replace log(10) with 2.30258509299405
since that's a totally unnessesary computation