home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH10 / A10252.WAV (.mp3) < prev    next >
Waveform Audio File Format  |  1993-10-22  |  352.2 KB  |  1 channel  |  11,025 sample rate  |  32 seconds
Transcription: The functions real and trunk convert the value of a fraction object to a number of type double or integer. These functions are declared to be friends so that they can be used much like the built-in type conversions in function notation. The function names real and trunk are used rather than the standard conversions float and int to avoid any ambiguities in arithmetic expressions. For example, if a is a fraction object, the expression a plus b cannot be interpreted as int plus int.