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 |
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: | 891 / 1076 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |