tuple_min
返回元组中最小的一个元素
min(t)
- tup:=[2,10,15,5,8,55,69,43]
- tupMin:=min(tup)
- *tupMin = 2
复制代码
tuple_min2
返回两个元组中最含最小元素的元组
min2(t1,t2)
- tup1:=[2,10,15,5,8,55,69,43]
- tup2:=[100,101,102,103,104,105,106,107]
- tupMin:=min2(tup1,tup2)
- *tupMin = [2,10,15,5,8,55,69,43]
复制代码
tuple_max
返回元组中最大的一个元素
max(t)
- tup:=[2,10,15,5,8,55,69,43]
- tupMax:=max(tup)
- *tupMax = 69
复制代码
tuple_max2
返回两个元组中最含最大元素的元组
max2(t1,t2)
- tup1:=[2,10,15,5,8,55,69,43]
- tup2:=[100,101,102,103,104,105,106,107]
- tupMax:=max2(tup1,tup2)
- *tupMax = [100,101,102,103,104,105,106,107]
复制代码
tuple_sum
返回所有元组元素的总和或字符串连接
sum(t)
- tup:=[2,10,15,5,8,55,69,43]
- tupSum:=sum(tup)
- *tupSum = 207
- tupStr:=['China','Beijing','Chaoyang','Road']
- tupSum:=sum(tupStr)
- *tupSum = 'ChinaBeijingChaoyangRoad'
复制代码
tuple_mean
返回元组的平均值
mean(a)
- tup:=[2,10,15,5,8,55,69,43]
- tupMean:= mean(tup)
- *tupMean = 25.875
复制代码
tuple_deviation
返回元组的标准偏差
deviation(a)
- tup:=[2,10,15,5,8,55,69,43]
- tupDiv:= deviation(tup)
- *tupDiv = 25.9033
复制代码
tuple_cumul
返回元组的累计总和
cumul(a)
- tup:=[2,10,15,5,8,55,69,43]
- tupCumul:= cumul(tup)
- *tupCumul = [2,12,27,32,40,95,164,207]
复制代码
tuple_median
返回元组从小到大排序后的中间值
median(a)
- tup:=[2,10,15,5,8,55,69,43]
- tupMedian:= median(tup)
- *tup1 := [2,5,8,10,15,43,55,69]
- *tupMedian = 15
复制代码
tuple_select_rank
返回元组从小到大排序后第i位索引的元素
select_rank(a,i)
- for i:= 0 to |tup|-1 by 1
- curEle := select_rank(tup,i)
- endfor
复制代码
tuple_sqrt
返回元组中每个元素的平方根
sqrt(a)
- tup:=[2,10,15,5,8,55,69,43]
- tupSqrt:= sqrt(tup)
- *tupSqrt = [1.41421,3.16228,3.87298,2.23607,2.82843,7.4162,8.30662,6.55744]
复制代码
tuple_deg
转换元组元素从弧度到角度
deg(a)
- tup:=[0.5,1.0,1.5,2.0,2.5,3.0,3.1415926]
- tupDeg:=deg(tup)
- *tupDeg = [28.6479,57.2958,85.9437,114.592,143.239,171.887,180.0]
复制代码
tuple_rad
转换元组元素从角度到弧度
rad(a)
- tup:=[28.6479,57.2958,85.9437,114.592,143.239,171.887,180.0]
- tupRad:=rad(tup)
- *tupRad = [0.5,1.0,1.5,2.0,2.5,3.0,3.1415926]
复制代码
tuple_real
转换整数到实数
real(a)
- Number:=520
- RealNum:=real(Number)
- *RealNum = 520.0
复制代码
tuple_int
转换实数到整数
int(a)
- Number:=520.1314
- IntNum:=int(Number)
- *IntNum = 520
复制代码
tuple_round
转换实数到整数(采取四舍五入法取整)
round(a)
- Number:=520.1314
- RoundNum:=round(Number)
- Number:=520.6999
- RoundNum:=round(Number)
复制代码
tuple_abs
转换整数或实数为它的绝对值
abs(a)
- Number:=-520.1314
- AbsNum:=abs(Number)
- Number:=520.1314
- AbsNum:=abs(Number)
- *AbsNum = 520.131
复制代码
tuple_fabs
转换实数(总是实数)为它的绝对值
fabs(a)
- Number:=-520.1314
- AbsNum:=fabs(Number)
- Number:=520.1314
- AbsNum:=fabs(Number)
- *AbsNum = 520.131
复制代码
tuple_ceil
不小于提供数的最小整数(向上取最小整)
ceil(a)
- Number:=520.1314
- CeilNum:=ceil(Number)
- *CeilNum = 521
复制代码
tuple_floor
不大于提供数的最大整数(向下取最大整)
floor(a)
- Number:=520.1314
- FloorNum:=floor(Number)
- *FloorNum = 520
复制代码
tuple_fmod
返回a1除以a2的余数
fmod(a1,a2)
- tup:=[2,5,8,12,15]
- fmodNum := fmod(tup,5)
- *fmodNum=[2.0,0.0,3.0,2.0,0.0]
复制代码
tuple_sgn
返回元组中元素的符号,以(1,0,-1)表示,符号正为1,0为0,符号负为-1
sgn(a)
- tup:=[2,-5,8,0,-12,15]
- tupSgn := sgn(tup)
- *tupSgn:=[1,-1,1,0,-1,1]
复制代码 |