package com.fr.function;
import com.fr.general.FArray;
import com.fr.script.AbstractFunction;
/**
* 自定义函数fiboFSM
* 输出结果是帆软的数组形式
*/
public class fiboFSM extends AbstractFunction {
public Object run(Object[] args) {
int n = Integer.parseInt(args[0].toString());
FArray<Long> res = new FArray<Long>();
long a = 0, b = 1;
for(int i = 0;i <= n;i++){
if(i < 2){
res.add((long)i);
} else {
long c = a + b;
res.add(c);
a = b;
b = c;
}
}
return res;
}
}