Fixed Point Maths

version 5 by Michael Callaghan

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 2 - Round up (rounds up to nearest integer)

    To decide which number is (N - a real number) rounded up:
        let result be the whole part of N;
        if the fractional part of N is less than 0:
            let result be result minus 1;
        if the fractional part of N is greater than 0:
            let result be result plus 1;
        decide on result.