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

12
LINES

< > BotCompany Repo | #1005874 // addToRange

JavaX fragment (include)

// can overwrite original object!
static Range addToRange(Range r, float val) {
  if (r == null)
    ret new Range(val);
  if (r.min > r.max)
    r.min = r.max = val;
  else {
    if (val < r.min) r.min = val;
    if (val > r.max) r.max = val;
  }
  ret r;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005874
Snippet name: addToRange
Eternal ID of this version: #1005874/1
Text MD5: 977ec4796842cbe11bf2d6d8ee2d4da9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-11 16:27:37
Source code size: 269 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 470 / 501
Referenced in: [show references]