Quote:
To avoid this kind of unwanted results, its smart to use given transformation of data types mentioned in Lesson 4 (its enough to use it only once on one operand) or to set constants so at least one operand is real type:
a = (float) 1 / 2; or
a = 1. / 2; or
a = 1 / 2.;
Important:
First case shows us way of using given transformation (it could also be used on second operand), and second and third example shows us possibility of adding spot, which declares constant as real number. This makes our result to be processed in real domain.
You call it a transformation- but why don't you call it what is commonly called in the majority of books- an explicit cast...(you could say both)