next up previous contents
Next: 3.1.8 Operators Up: 3.1.7 Parameters and Values Previous: Literals Type Conversions

Since MDL enforces exact type conformance within all expressions, explicit type conversions are required for any operation which uses arguments of different types. The syntax to explicitly convert the type of the expression expr2 to the type newtype of the expression expr1 is analogous to the syntax of C and C++ style cast expressions:

expr1 = ( newtype ) expr2 ;

While instantiating such a cast, it is strictly checked, whether the cast is defined as a valid cast expression within the Algorithm Library or one of the user defined parameter libraries. For the built-in parameter types it is not checked if overflows occur. Such checks can be defined by user defined parameter types on demand.

Robert Mlekus