Respond to this messageReturn to Index
Original Message
  • Pi
    • (no login)
      Posted Apr 19, 2012 3:04 PM

      Hi all,

      I get a paremeter type mismatch, why ?

      DIM PI AS LONG
      DIM A AS LONG
      DIM B AS LONG
      DIM C AS LONG

      DECLARE SUB P (PI, A, B, C, count, n)


      ' intitialisation

      CLS
      n = 0
      PI = 0: A = 1: B = SQR(1 / 2): C = 1 / 4

      count = 5 ' max = 10

      ' Call P, 1 time

      CALL P(PI, A, B, C, count, n)
      PRINT PI

      END

      'SUB //////////////////////

      SUB P (PI, A, B, C, count, n)


      ' n = n + 1
      IF n >= count THEN EXIT SUB

      PI = ((A + B) ^ 2) / (4 * C)

      CALL P(PI, (A + B) / 2, SQR(A * B), C - 2 * (((A - B) / 2) ^ 2), count, n + 1)

      END SUB






    Your Name
    Message Title
    Message Text
    Options