2.3. Expressions

Felix provides many of the operators found in C. Here is are some examples with equivalent function calls. Note: there are no shift operators, although there are equivalent functions. [The symbols are too useful to waste for an infrequently used facility]. There are no bitwise operators, because both & and | have different uses.
Start felix section to tut/tutorial/tut-1.03-0.flx[1 /1 ]
     1: #line 101 "./lpsrc/flx_tutorial.pak"
     2: #import <flx.flxh>
     3: // arith
     4: print (1 + 1); endl; print (add (1,2)); endl;
     5: print (1 - 1); endl; print (sub (1,2)); endl;
     6: print (1 * 1); endl; print (mul (1,2)); endl;
     7: print (1 / 1); endl; print (div (1,2)); endl;
     8: 
     9: print (1.2 ** 1.2); endl;
    10: print (pow  (1.2,1.2)); endl;
    11: 
    12: // boolean
    13: print (not false); endl;
    14: print (lnot false); endl;
    15: 
    16: print (true and false); endl;
    17: print (land (true,false)); endl;
    18: 
    19: print (true or false); endl;
    20: print (lor  (true,false)); endl;
    21: 
    22: // comparison
    23: print (1 == 2); endl; print (eq (1,2)); endl;
    24: print (1 != 2); endl; print (ne (1,2)); endl;
    25: print (1 < 2); endl; print (lt (1,2)); endl;
    26: print (1 > 2); endl; print (gt (1,2)); endl;
    27: print (1 <= 2); endl; print (le (1,2)); endl;
    28: print (1 >= 2); endl; print (ge (1,2)); endl;
End felix section to tut/tutorial/tut-1.03-0.flx[1]
Start data section to tut/tutorial/tut-1.03-0.expect[1 /1 ]
     1: 2
     2: 3
     3: 0
     4: -1
     5: 1
     6: 2
     7: 1
     8: 0
     9: 1.24456
    10: 1.24456
    11: true
    12: true
    13: false
    14: false
    15: true
    16: true
    17: false
    18: false
    19: true
    20: true
    21: true
    22: true
    23: false
    24: false
    25: true
    26: true
    27: false
    28: false
End data section to tut/tutorial/tut-1.03-0.expect[1]