1 | static class Range { |
2 | float min = 1f, max = 0f; // indicates no range |
3 | |
4 | *() {} |
5 | *(float x) { min = max = x; } |
6 | *(float *min, float *max) {} |
7 | |
8 | bool empty() { ret min > max; } |
9 | float length() { ret max(0f, max-min); } |
10 | } |
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: | 545 / 1236 |
Version history: | 1 change(s) |
Referenced in: | [show references] |