數組的運算
- 基本運算
運算 | 對應函數 |
---|---|
y = x1 + x2 | add(x1, x2 [, y]) |
y = x1 - x2 | subtract(x1, x2 [, y]) |
y = x1 * x2 | multiply (x1, x2 [, y]) |
y = x1 / x2 | divide (x1, x2 [, y]), 如果兩個陣列的元素為整數,那麼用整數除法 |
y = x1 / x2 | true_divide(x1, x2 [, y]), 總是返回精確的商 |
y = x1 // x2 | floor_divide (x1, x2 [, y]), 總是返回商值取整 |
y = -x | negative(x [,y]) |
y = x1**x2 | power(x1, x2 [, y]) |
y = x1 % x2 | remainder(x1, x2 [, y]), mod(x1, x2, [, y]) |
- 三角函數
sin(x, /[, out, where, casting, order, …]) | 三角正弦,元素。 |
cos(x, /[, out, where, casting, order, …]) | 餘弦元素。 |
tan(x, /[, out, where, casting, order, …]) | 計算切線元素。 |
arcsin(x, /[, out, where, casting, order, …]) | 反正弦,元素。 |
arccos(x, /[, out, where, casting, order, …]) | 三角反餘弦,元素方式。 |
arctan(x, /[, out, where, casting, order, …]) | 三角反正切,逐元素。 |
arctan2(x1, x2, /[, out, where, casting, …]) | x1/x2正確選擇象限的逐元素反正切。 |
hypot(x1, x2, /[, out, where, casting, …]) | 給定直角三角形的“腿”,返回其斜邊。 |