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

9
LINES

< > BotCompany Repo | #1014299 // doubleRatio - dividing without DivisionByZero

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

Libraryless. Click here for Pure Java version (30L/1K).

1  
static double doubleRatio(double x, double y) {
2  
  ret y == 0 ? 0 : x/y;
3  
}
4  
5  
ifclass Seconds
6  
static double doubleRatio(Seconds x, Seconds y) {
7  
  ret doubleRatio(x!, y!);
8  
}
9  
endif

Author comment

Began life as a copy of #1012740

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014299
Snippet name: doubleRatio - dividing without DivisionByZero
Eternal ID of this version: #1014299/3
Text MD5: 14788badd5554a3d9e10498927fb23a2
Transpilation MD5: c1f88596fd18b2bd2e0a98680656aaf9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-23 08:09:28
Source code size: 183 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 408 / 508
Version history: 2 change(s)
Referenced in: [show references]