====== 数値について ====== ==== 資料 ==== なし。 ==== 概要 ==== Miniscriptでは、数値の型は小数型で統一されてます。 (整数/小数で変数を分ける必要がない、という言い方が正しいですね) 完全精度(full-precision format)で計算しますが、出力は環境や実装機器によって違うため、環境ごとの数値の取り扱いは一応確認しておくのがいいと思います。 === 例 === コマンドプロンプト版Miniscriptは、整数部32桁・小数点6位までの取り扱いになります。 C#のMiniscriptをUnityに組み込む場合、C#の取り扱いに準拠するため、本体プログラム側ではdoubleまでは取り扱い可能な模様。 ==== 利用可能な演算子 ==== * 四則演算(+,-,*,/) * 剰余(%) * 乗算(^) * 論理演算(and/or/not) * 比較( == , != ,>, >= ,<, <= ) ==== サンプルプログラム ==== print (1+2*3)/7 print 10%3 print 2^10 print 0 and 1 //0を返す print 0 !=1 //1を返す print not 0==1 //1を返す n=5 if n<0 then print "region 1" else if n>=0 and n<2 then print "region 2" else if n>=2 then if n==5 then print "n is 5" //今回は数値は5のためこれが表示される else if n!=5 then print "n is not 5" end if end if