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

6
LINES

< > BotCompany Repo | #1013111 // assertBetween (inclusive)

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

Libraryless. Click here for Pure Java version (9241L/51K).

meta-for long in long, int, double {
  svoid assertBetween(S msg default "", long a, long b, long x) {
    ret if x >= a && x <= b;
    fail(colonCombine(msg, x + " is not between " + a + " and " + b));
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1013111
Snippet name: assertBetween (inclusive)
Eternal ID of this version: #1013111/5
Text MD5: 447a50a155c2a8d9802e1fe72e0d7e9c
Transpilation MD5: 1e39489911ac50b06b2a052cf98e8e5e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-08 23:48:21
Source code size: 213 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 353 / 443
Version history: 4 change(s)
Referenced in: [show references]