Compatibility Note If your compiler does not accept the ios_base forms in setf(), try using the older ios forms instead. Some C++ implementations based on pre-ANSI C compilers don't support the f suffix for floating-point constants. If you find yourself facing thisproblem, you can replace 1.e7f / 9.0f with (float) 1.e7 /(float)9.0. Some implementations suppress trailing zeros. Here is the output from the program in Listing 3.11 for oneimplementation: Integer division: 9/5 = 1Floating-point division: 9.0/5.0 = 1.800000Mixed division: 9.0/5 = 1.800000double constants: 1e7/9.0 = 1111float constants: 1e7f/9.0f = 1100 The first output line shows that dividing the integer 9 by the integer 5yields the integer 1. The fractional part of 4 / 5 (or 0.8) is discarded.(You'll see a practical use for this kind of division when you learn aboutthe modulus operator, later in this chapter.) The next two lines show that whenat least one of the operands is floating-point, you get a floating-point answerof 1.8. Actually, when you try to combine mixed types, C++ converts all theconcerned types to the same type.
The Lazarus Project Brian Tyler Rapidshare S. Data Compression - - Section 3. The classic defined- word scheme was developed over 3. Huffman's well- known paper on minimum- redundancy coding.
You'll learn about these automaticconversions later in this chapter. The relative precisions of the last two linesshow that the result is type double if both operands are double and that it is float if both operands are float. Remember, floating-point constants are type double bydefault.