Next: , Previous: , Up: Full Syntax Description   [Contents][Index]


10.2.8.5 Type coercion

The type coercion is like a type cast in C. Its syntax is

(type)ident

Type coercion associates left, and has the same precedence as unary negation operators (i.e. the highest one).

The result of type coercion is as follows:

typeVariable typeResulting conversion
integerintegerNo conversion. This results in the same integer value.
integerstringIf the string value of the variable is a valid ASCII representation of the integer number (either decimal, octal, or hex), it is converted to the integer; otherwise the result of the conversion is undefined.
stringintegerThe ASCII representation (in decimal) of the integer number.
stringstringNo conversion. This results in the same string value.