minus
(-) 減算演算子, 符号変更
呼び出し手順
X - Y -Y
引数
- X, Y
数値,多項式または有理数のスカラーまたはベクトルまたは行列.
syslinリストを指定することも可能です.
説明
減算
数値オペランドの場合,一般的な意味と同じく減算を意味します.
オペランドの一つが行列でもう一つがスカラーの場合,
演算子は要素毎に適用されます.
Y==[]の場合, Xが返され,
X==[]の場合, -Yが返されます.
As soon as a boolean is involved in a substraction with a number (decimal, complex,
or encoded integer), it is automatically converted in the type (and integer type)
of the number before performing the substraction or the sign change, as
%F => 0 and %T => 1.
Whatever is the (regular) type of X, then []-X,
X-[], and -[] return [].
減算は,"ソフトコードされた"演算により他のデータ型についても 定義できます (オーバーローディング参照).
例
[] - 2 1 - [] [2, 5] - 1 [2, 5] - [3 -2] %s - 2 1/%s - 2
--> [] - 2
ans =
[]
--> 1 - []
ans =
[]
--> [2, 5] - 1
ans =
1. 4.
--> [2, 5] - [3 -2]
ans =
-1. 7.
--> %s - 2
ans =
-2 +s
--> 1/%s - 2
ans =
1 - 2s
-------
s
With booleans:
--> -[%f %t] ans = 0. -1. --> [%f %f %t %t] - [%f %t %f %t] ans = 0. -1. 1. 0. --> %t - %i ans = 1. - i --> c = %t - int8(7), typeof(c) c = -6 ans = int8
参照
- plus — 数値の加算。 テキストの連結(グループ化)
- operators — scilab 演算子の名前
- overloading — 表示,関数および演算子オーバーロード機能
- oldEmptyBehaviour — Controls the operation+ and operation- behaviour for Scilab
- mtlb_s — Matlab subtraction emulation function
履歴
| バージョン | 記述 |
| 6.0.0 | A - [] and [] - A now return
[] instead of A or -A. |
| Report an issue | ||
| << less | Scilab keywords | not >> |