等比級数

geomSeries<-function(stval,endval,n){
 exp(seq(from=log(stval),to=log(endval),length.out=n))
}
> stval<-runif(1)
> endval<-runif(1)
> n<-10
> gsout<-geomSeries(stval,endval,n)
> for( i in 1:(length(gsout)-1)){ print(gsout[i]/gsout[i+1])}
[1] 0.9570482
[1] 0.9570482
[1] 0.9570482
[1] 0.9570482
[1] 0.9570482
[1] 0.9570482
[1] 0.9570482
[1] 0.9570482
[1] 0.9570482