Fixed Point Maths

version 5 by Michael Callaghan

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 9 - Natural logarithms

    To decide what real number is the natural log of (N - a real number):
        if N real equals 0.0000:
            decide on 0.0000;
        if N is real less than 0.0000:
            decide on 0.0000;
        let temp1 be N real minus 1;
        let temp2 be N real plus 1;
        let temp be temp1 real divided by temp2;
        let result be temp;
        repeat with X running from 3 to 7:
            let temp1 be temp to the power X;
            let temp2 be X as a fixed point number;
            let temp1 be temp1 real divided by temp2;
            let result be result real plus temp1;
            increase x by 1;
        let result be result real times 2;
        decide on result.

    To decide what real number is the natural log of (N - a number):
        let temp be N as a fixed point number;
        decide on the natural log of temp.