[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            rdiv - divide using REAL math

  Syntax              struct REAL rdiv(long int numer, long int denom,
                                       int precision);

  Prototype in        real.h

  Remarks             rdiv divides numer by denom to precision decimal
                      places, returning the quotient as a REAL. The
                      actual value is calculated to precision+1 accuracy
                      and rounded to precision accuracy.

                      Errors, such as division by zero and requests for a
                      quotient with a precision larger than the maximum
                      precision allowed, are trapped and the returned
                      structure's rint and rfrac values will be -1. If
                      division by zero occurs, precision will be -1 and
                      the error code will be RDIVBYZERO. If the precision
                      requested is greater than the maximum allowed
                      precision, precision will be set to MAXPRECISION
                      and the error code will be RPLOSS.

                      Refer to the section SIMULATED FP MATH for further
                      details.

  Return value        returns numer divided by denom as a REAL with
                      precision decimal places. If an error occurred, the
                      returned structure's values will all be -1 (rint,
                      rfrac and precision) and _rmatherr will contain the
                      error code.

  See also            _rmatherr
                      radd(), rceil(), rfloor(), rnegate(), rnormalize(),
                      rsign(), rsub()


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