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

9
LINES

< > BotCompany Repo | #1012740 // ratio - dividing without DivisionByZero

JavaX fragment (include)

1  
ifndef ratioIsDouble
2  
static long ratio(long x, long y) {
3  
  ret y == 0 ? 0 : x/y;
4  
}
5  
endifndef
6  
7  
static double ratio(double x, double y) {
8  
  ret y == 0 ? 0 : x/y;
9  
}

Author comment

Began life as a copy of #1008544

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: #1012740
Snippet name: ratio - dividing without DivisionByZero
Eternal ID of this version: #1012740/5
Text MD5: 919421d24fcd67c0b3dc44342d9a2e6b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-06-04 03:31:57
Source code size: 169 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 620 / 626
Version history: 4 change(s)
Referenced in: [show references]