Rail3D*


 

Operators



Arithmetic operators

+ - / * %

Logical Operators

  • && logical and
  • || logical or
  • ! logical not

String operators

  • + may be used to concatenate string variables.

Comparison operators

< > == !=

Unary operators

++		--

The unary operators (increment and decrement) may only be used as standalone commands, eg

a++;

and may not be used within an expression.

Note on expression type.

The “type” of an expression is determined by the type of the value. Thus in the following examples:

1)		int a;
		a= b + c;
2)		float b;
		b= a+c;
3)		str c;
		c=a+b;

in case 1 the expression is evaluated in integers, in case 2 in floats and in case 3 in strings regardless of the type of the variables on the right of the expression.

Note that logical operators are not valid with floats and strings expressions only include string concatenation.



import