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

15
LINES

< > BotCompany Repo | #1035706 // growRange - grows to both sides

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

Transpiled version (13110L) is out of date.

1  
static DoubleRange growRange(DoubleRange r, double amount) {
2  
  ret r == null ?: doubleRange(r.start-amount, r.end+amount);
3  
}
4  
5  
static DoubleRange growRange(double amount, DoubleRange r) {
6  
  ret growRange(r, amount);
7  
}
8  
9  
static IntRange growRange(IntRange r, int amount) {
10  
  ret r == null ?: intRange(r.start-amount, r.end+amount);
11  
}
12  
13  
static IntRange growRange(int amount, IntRange r) {
14  
  ret growRange(r, amount);
15  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035706
Snippet name: growRange - grows to both sides
Eternal ID of this version: #1035706/3
Text MD5: c3b8ed9423d034bb3095e9fd34721f46
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-11-14 18:45:15
Source code size: 427 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 156 / 212
Version history: 2 change(s)
Referenced in: [show references]