Hi all.
I have some prob with log function.
The code below is not working, it returns a false value.
The value is not same with what I calculate using scientific calculator.
Using my program:
N=2
Na=1
log(N/Na)=0.6931
Using scientific calculator:
N=2
Na=1
log(N/Na)=0.30102999566
VB Code:
Na = 0 temp = 0 temp1 = 0 rs.MoveFirst Do For column = 1 To rs.Fields.Count - 1 'If rs.Fields(column) <> Null Then If Not IsNull(rs.Fields(column).Value) Then Na = Na + 1 End If Next column N = rs.Fields.Count - 1 temp = Log(N / Na) temp1 = Format(temp, "0.0000") rs2.AddNew rs2!Na = temp1 rs2.Update Na = 0 rs.MoveNext Loop Until rs.EOF




Reply With Quote