Mercurial Hosting > luan
comparison src/luan/lib/BasicLib.java @ 112:f5af13062b10
fix previous rev
git-svn-id: https://luan-java.googlecode.com/svn/trunk@113 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 23 May 2014 22:52:39 +0000 |
parents | 2428ecfed375 |
children | eacf6ce1b47d |
comparison
equal
deleted
inserted
replaced
111:2428ecfed375 | 112:f5af13062b10 |
---|---|
206 if( step == 0.0 ) | 206 if( step == 0.0 ) |
207 throw luan.JAVA.exception("bad argument #3 (step may not be zero)"); | 207 throw luan.JAVA.exception("bad argument #3 (step may not be zero)"); |
208 return new LuanFunction() { | 208 return new LuanFunction() { |
209 double v = from; | 209 double v = from; |
210 | 210 |
211 @Override public Object[] call(LuanState luan,Object[] args) { | 211 @Override public Object call(LuanState luan,Object[] args) { |
212 if( step > 0.0 && v > to || step < 0.0 && v < to ) | 212 if( step > 0.0 && v > to || step < 0.0 && v < to ) |
213 return LuanFunction.EMPTY; | 213 return LuanFunction.EMPTY; |
214 double rtn = v; | 214 double rtn = v; |
215 v += step; | 215 v += step; |
216 return new Object[]{rtn}; | 216 return rtn; |
217 } | 217 } |
218 }; | 218 }; |
219 } | 219 } |
220 | 220 |
221 } | 221 } |