Home Segments Index Top Previous Next

52: Mainline

For most integers, the short integer type is slightly small, and any data type larger than int is unnecessarily large. Analogously, for most floating-point numbers, the float floating-point type is slightly small, and any data type larger than double is unnecessarily large. Consequently, most programmers use int and double more than they do any other integer and floating-point types, and all the programs in the rest of this book use int and double for all integers and floating-point numbers. Conveniently, the %i print specification works for both short and int integers, and the %f print specification works for both float and double numbers.