1 | static IterableIterator<int> enumerateIntegers() {
|
2 | ret iteratorFromFunction(new O {
|
3 | long i = 1; |
4 | |
5 | Int get() {
|
6 | if (i > Integer.MAX_VALUE*2L) null; |
7 | int result = (int) (odd(i) ? -i/2 : i/2); |
8 | ++i; |
9 | ret result; |
10 | } |
11 | }); |
12 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1010208 |
| Snippet name: | enumerateIntegers - returns 0, 1, -1, 2, -2, ... |
| Eternal ID of this version: | #1010208/4 |
| Text MD5: | 85a7c0bb8f46e82cf650e498f5373f91 |
| Author: | stefan |
| Category: | javax / maths |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-09-06 20:05:33 |
| Source code size: | 266 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 623 / 677 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |