a=2; int b=2*a; return bType declarations for local variables are:
if (c) {return 2} else {return 3};or
if (!c) {return 2} else if (b == 2) {return b * 10} else {return 3}If-then-else expressions can also be used inside other expresiosn or code blocks. For example:
if (!c) {return 2} else if (b == 2) { if (d == 3) { return 25} else {return 45} } else {return 3};
int c = 0; int d = 0; while (c < 10) { d = d + a; c = c + 1};
if (!c) {return 2} /* first if */ else if (b == 2) { if (d == 3) { return 25} else {return 45} } else {return 3};
Function | Syntax | Definition |
---|---|---|
abs | abs(a) | Absolute value |
sin | sin(a) | Sinus (input in radians) |
cos | cos(a) | Cosinus (input in radians) |
tan | tan(a) | Tangent (input in radians) |
asin | asin(a) | Arc sinus |
acos | acos(a) | Arc cosinus |
atan | atan(a) | Arc tangent |
atn2 | atn2(a) | Arc tangent 2 |
pow | pow(a, b) | a power b (for example pow(a, 2) is a * a) |
sqrt | sqrt(a) | Square root |
PI | PI | The PI constant |
toDegrees | toDegrees(a) | Conversion from radians to degrees |
toRadians | toRadians(a) | Conversion from degrees to radians |
Copyright 2016-2017 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v2 licence