6.1.9. BOZ literal constants

6.1.9 BOZ literal constants

Besides decimal constants, Fortran also supports binary (b), octal (o) and hexadecimal (z) integer constants. The syntax is: ‘prefix quote digits quote’, were the prefix is either b, o or z, quote is either ' or " and the digits are for binary 0 or 1, for octal between 0 and 7, and for hexadecimal between 0 and F. (Example: b'01011101'.)

Up to Fortran 95, BOZ literals were only allowed to initialize integer variables in DATA statements. Since Fortran 2003 BOZ literals are also allowed as argument of REAL, DBLE, INT and CMPLX; the result is the same as if the integer BOZ literal had been converted by 登录查看完整内容