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 C++ section to tut/examples/tut102a.flx[1 /1 ]
     1: include "std";
     2: // arith
     3: print (1 + 1); endl; print (add (1,2)); endl;
     4: print (1 - 1); endl; print (sub (1,2)); endl;
     5: print (1 * 1); endl; print (mul (1,2)); endl;
     6: print (1 / 1); endl; print (div (1,2)); endl;
     7: 
     8: print (1.2 ** 1.2); endl;
     9: print (pow  (1.2,1.2)); endl;
    10: 
    11: // boolean
    12: print (not false); endl;
    13: print (lnot false); endl;
    14: 
    15: print (true and false); endl;
    16: print (land (true,false)); endl;
    17: 
    18: print (true or false); endl;
    19: print (lor  (true,false)); endl;
    20: 
    21: // comparison
    22: print (1 == 2); endl; print (eq (1,2)); endl;
    23: print (1 != 2); endl; print (ne (1,2)); endl;
    24: print (1 < 2); endl; print (lt (1,2)); endl;
    25: print (1 > 2); endl; print (gt (1,2)); endl;
    26: print (1 <= 2); endl; print (le (1,2)); endl;
    27: print (1 >= 2); endl; print (ge (1,2)); endl;
    28: 
End C++ section to tut/examples/tut102a.flx[1]