RealCompare¶
Real comparison expr ASR node.
Declaration¶
Syntax¶
RealCompare(expr left, cmpop op, expr right, ttype type, expr? value)
Arguments¶
| Argument Name | Argument Description | 
|---|---|
| 
 | left side of the comparison operand | 
| 
 | right side of the comparison operand | 
| 
 | comparison operator | 
| 
 | table entry type | 
| 
 | expression value | 
Return values¶
The return value is the expression that the RealCompare represents.
Description¶
RealCompare represents real floating point comparison operation.
Comparison operation can be:
- Less than 
- Greater than 
- Less than or equal to 
- Greater than or equal to 
- Equal to 
Types¶
Only accepts real constants, real exponents, floating point values.
Examples¶
2.1 > 1.
ASR:
(TranslationUnit
    (SymbolTable
        1
        {
        })
    [(RealCompare
        (RealConstant
            2.100000
            (Real 4 [])
        )
        Gt
        (Cast
            (IntegerConstant 1 (Integer 4 []))
            IntegerToReal
            (Real 4 [])
            (RealConstant
                1.000000
                (Real 4 [])
            )
        )
        (Logical 4 [])
        (LogicalConstant
            .true.
            (Logical 4 [])
        )
    )]
)