1.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/examples/tut_beg102a.flx[1 /1 ]
     1: #line 78 "./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;
    29: 
End felix section to tut/examples/tut_beg102a.flx[1]