Libraryless. Click here for Pure Java version (3796L/22K).
1 | static ItIt<Double> geometricIterator(double a, double b, double factor) { |
2 | assertTrue("factor > 1", factor > 0); |
3 | |
4 | ret new ItIt<Double>() { |
5 | double i = a; |
6 | |
7 | public bool hasNext() { ret i < b; } |
8 | public Double next() { var j = i; i *= factor; ret j; } |
9 | }; |
10 | } |
Began life as a copy of #1018110
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033257 |
Snippet name: | geometricIterator - count from a to b (exclusively) with step factor |
Eternal ID of this version: | #1033257/4 |
Text MD5: | 2043982cd9591bbccc86ec135720dac7 |
Transpilation MD5: | 98748324f5c165a1762d78902397380d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-17 22:37:39 |
Source code size: | 284 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 126 / 182 |
Version history: | 3 change(s) |
Referenced in: | [show references] |