数値演算式

MAXScript の数値演算式は、加算、減算、乗算、除算などの算術の共通演算子式に相当します。MAXScript での <math_expr> の構文を次に示します。

<math_operand> + <math_operand> -- standard arithmetic addition 
<math_operand> - <math_operand> -- standard arithmetic subtraction
<math_operand> * <math_operand> -- standard arithmetic multiplication
<math_operand> / <math_operand> -- standard arithmetic division
<math_operand> ^ <math_operand> -- exponential, raise to the power
<math_operand> as <class> -- conversion between types

ここでは、<math_operand> は次のうちのいずれかになります。

<operand>
<function_call>
<math_expr>
注: 数値演算子は別のネスト数値演算式になることもあります。オペランドおよび演算子の任意のシーケンスを作成できる再帰的な構文を定義する別の例を示します。数値演算の単項マイナスは <operand> タイプであることに注意してください。詳細は、「オペランド」を参照してください。

例:

   42
   2 + 2
   2 * a - sin x / b -- using a function call
   (a + b) * -c
   2 ^ n
   (n + 1) as string -- converts result to a string value

変換演算子 as は、選択されたソースおよびデスティネーション値タイプの組み合わせ間で動作します。ある値から別の値に変換できる値の種類は限られています。これらの変換は値タイプごとに定義され、値タイプの説明と一緒に文書化されます。