Math.floor



Can someone direct me in the right direction on this? I just don't
understand what it's asking.
An Application of method.floor is rounding a value to the nearest integer.
The statement y = math.floor( x + 0.5 ); will round the number x to the
nearest integer and assign the result to y. Write an application that reads
double value and uses the preceding statement to round each of the numbers
to the nearest integer. For each number proceeded, display both the original
number and rounded number.




.



Relevant Pages

  • RE: Rounding of floating point numbers
    ... what I am trying to do, I don't think "banker's rounding" will work. ... The total number of patterns I need will vary each time the ... The rule I must follow for odd numbers is to divide by two, round up ... nearest integer, numbers with .51 are always rounded up ...
    (perl.beginners)
  • Re: Rounding a floating point number
    ... snip float rounding discussion ... ... functions round to nearest integer. ... but I am claiming that using the C99 functions to round to N ...
    (comp.lang.c)
  • Re: Rounding a floating point number
    ... snip float rounding discussion ... ... functions round to nearest integer. ... but I am claiming that using the C99 functions to round to N ...
    (comp.lang.c)
  • Re: Round to Nearest Integer in Access
    ... always round to the nearest integer. ... For gimmicky supermarket 'rounding ...
    (microsoft.public.access.queries)
  • Re: Rounding of floating point numbers
    ... > easy way out and use the POSIX solution to get the program written. ... Didn't you mean the other way around, i.e. rounding to the nearest even ... nearest integer, numbers with .51 are always rounded up ... The function round1rounds just like printf and the function round2 ...
    (perl.beginners)