Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1024817 // floatIota - iterator of floats in range with defined step

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (58L/1K).

1  
// max = inclusive
2  
static ItIt<Float> floatIota(float min, float max, float step) {
3  
  ret new ItIt<Float>() {
4  
    float f = min;
5  
    
6  
    public bool hasNext() { ret f <= max; }
7  
    public Float next() { float x = f; f += step; ret x; }
8  
  };
9  
}

Author comment

Began life as a copy of #1015352

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024817
Snippet name: floatIota - iterator of floats in range with defined step
Eternal ID of this version: #1024817/2
Text MD5: ee542fae2b31a34739301416ce97e6a3
Transpilation MD5: b143de642fbd83fe260e021a34bfd55e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-26 13:13:25
Source code size: 251 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 204 / 301
Version history: 1 change(s)
Referenced in: [show references]