BitCast

Cast bits to 1 or 0.

声明

语法

BitCast(expr source, expr mold, expr? size, ttype type, expr? value)

参数

Argument Name

Argument Description

source

source expression

mold

mold expression

size

size of expression

type

table entry type

value

expression value

返回值

The return value is the expression that the BitCast represents.

描述

BitCast represents casting bits to 0 or 1.

类型

Only accepts integers.

示例

integer :: x = 21432
print *, transfer(x, 1.0)

ASR:

(TranslationUnit
    (SymbolTable
        1
        {
            x:
                (Variable
                    1
                    x
                    Local
                    (IntegerConstant 21432 (Integer 4 []))
                    ()
                    Save
                    (Integer 4 [])
                    Source
                    Public
                    Required
                    .false.
                )

        })
    [(Print
        ()
        [(BitCast
            (Var 1 x)
            (RealConstant
                1.000000
                (Real 4 [])
            )
            ()
            (Real 4 [])
            ()
        )]
        ()
        ()
    )]
)

也可以看看