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

9
LINES

< > BotCompany Repo | #1022936 // RandomAndVary_Float

JavaX fragment (include)

sclass RandomAndVary_Float implements RandomAndVary<Float> {
  float min = 0, max = 1;
  double varyFactor = 0.1;
  
  public Float randomInstance() { ret randomFloat(min, max); }
  public Float varyInstance(Float a) {
    ret (float) clipDouble(min, max, a+(max-min)*varyFactor);
  }
}

Author comment

Began life as a copy of #1022932

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1022936
Snippet name: RandomAndVary_Float
Eternal ID of this version: #1022936/2
Text MD5: b09c8c995286c4a502cfc492ef92dd1b
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-14 23:19:02
Source code size: 294 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 275 / 704
Version history: 1 change(s)
Referenced in: [show references]