It is important to understand when the conversion takes place since this may effect the result. Consider the following:
real r = 3, h1, h2 int i = 10 h1 = i / r h2 = i / 3 |
Here, in the second division the integer result of i / 3
will be converted to a real before being assigned to h2,
while in the first division
texttti will be converted to a real
before being used in the division. Thus, h1 = 3.33333 and
h2 = 3.00000.
MPD contains conversion functions for the five basic types, integers, booleans, reals, characters and strings as well as for three user defined sorts of types, enumerations, pointers and arrays of characters.
See appendix C of the SR Book (available from the MPD web page) for a complete list of those functions.