[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            round - round a real to a decimal place

  Syntax              double round(double x, int n);

  Prototype in        mathhk.h

  Remarks             round will round off a double to x amount of
                      decimal places. Only zero or greater values are
                      valid for n (non-zegative). No error checking is
                      done.

  Return value        returns x rounded to n decimal places.

  See also            frac()

  Example             #include <mathhk.h>

                      main()
                      {
                           printf("Round %lf to %d places = %lf\n",2.307,
                                  2,round(2.307,2));

  Program output      Round 2.307 to 2 places = 2.31

  Example             see demonum.c


See Also: frac()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson