Libraryless. Click here for Pure Java version (1663L/11K).
1 | srecord PosNegScore(double pos, double neg) implements Comparable<PosNegScore> { |
2 | double diff() { ret pos-neg; } |
3 | |
4 | public int compareTo(PosNegScore s) { ret cmp(diff(), s.diff()); } |
5 | |
6 | toString { |
7 | if (neg == 0) ret pos == 0 ? "0" : "+" + pos; |
8 | if (pos == 0) ret "-" + neg; |
9 | ret "+" + pos + "/-" + neg; |
10 | } |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021975 |
Snippet name: | PosNegScore |
Eternal ID of this version: | #1021975/5 |
Text MD5: | aaf6b05e1b1c944fec4be66545db7a20 |
Transpilation MD5: | 62e36385b532e2523589c68971cd4b2b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-06-25 01:58:34 |
Source code size: | 332 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 275 / 809 |
Version history: | 4 change(s) |
Referenced in: | [show references] |