home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH10 / A10252.TXT < prev    next >
Encoding:
Text File  |  1993-09-27  |  511 b   |  9 lines

  1. The functions real() and trunc() convert the value of a Fraction
  2. object to a number of type double or integer.  These functions are
  3. declared to be friends so that they can be used, much like the
  4. built-in type conversions, in function notation.  The function
  5. names real() and trunc() are used rather than the standard
  6. conversions float() and int() to avoid any ambiguities in
  7. arithmetic expressions.  For example, if "a" is a Fraction object,
  8. the expression "a + 2" cannot be interpreted as "int + int".
  9.