Results 1 to 5 of 5

Thread: [RESOLVED] Log Function

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    79

    Resolved [RESOLVED] Log Function

    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:
    1. Na = 0
    2. temp = 0
    3. temp1 = 0
    4. rs.MoveFirst
    5. Do
    6.     For column = 1 To rs.Fields.Count - 1
    7.         'If rs.Fields(column) <> Null Then
    8.         If Not IsNull(rs.Fields(column).Value) Then
    9.             Na = Na + 1
    10.         End If
    11.     Next column
    12.     N = rs.Fields.Count - 1
    13.     temp = Log(N / Na)
    14.     temp1 = Format(temp, "0.0000")
    15.     rs2.AddNew
    16.     rs2!Na = temp1
    17.     rs2.Update
    18. Na = 0
    19. rs.MoveNext
    20. Loop Until rs.EOF
    Last edited by Rina; Sep 5th, 2005 at 01:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width