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

10
LINES

< > BotCompany Repo | #1005873 // class Range - range of floats (min/max) - shoud use DoubleRange instead

JavaX fragment (include)

static class Range {
  float min = 1f, max = 0f; // indicates no range
  
  *() {}
  *(float x) { min = max = x; }
  *(float *min, float *max) {}
  
  bool empty() { ret min > max; }
  float length() { ret max(0f, max-min); }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005873
Snippet name: class Range - range of floats (min/max) - shoud use DoubleRange instead
Eternal ID of this version: #1005873/2
Text MD5: 96d70ac5b90bbcc4bab8ad92a9524c2c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-30 18:45:46
Source code size: 236 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 474 / 1158
Version history: 1 change(s)
Referenced in: [show references]