Fixed Point Maths

version 5 by Michael Callaghan

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 5 - Degrees to radians and radians to degrees

    To decide what real number is (N - a real number) in radians:
        let temp be N real times Pi;
        let temp be temp real divided by 180.0000;
        decide on temp.

    To decide what real number is (N - a number) in radians:
        let temp be N as a fixed point number;
        decide on temp in radians.

    To decide what real number is (N - a real number) in degrees:
        let temp be N real times 57.2958;
        let angle be the whole part of temp;
        let decimal be the fractional part of temp;
        let temp1 be decimal real divided by 1000.0000;
        let temp2 be temp1 rounded up;
        if temp2 is 10:
            let temp2 be 0;
            let angle be angle plus 1;
        otherwise:
            let temp2 be temp2 times 1000;
        let result be the real number with whole part angle fractional part temp2;
        decide on result.

    To decide what real number is (N - a number) in degrees:
        let temp be N as a fixed point number;
        decide on temp in degrees.