1 | static boolean eq(Object a, Object b) { |
2 | if (a == null) return b == null; |
3 | if (a == b) true; |
4 | if (a.equals(b)) true; |
5 | if (a instanceof BigInteger) { |
6 | if (b instanceof Integer) return a.equals(BigInteger.valueOf((Integer) b)); |
7 | if (b instanceof Long) return a.equals(BigInteger.valueOf((Long) b)); |
8 | } |
9 | return false; |
10 | } |
Began life as a copy of #1000860
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1001026 |
Snippet name: | extended eq function equating BigIntegers with ints/longs |
Eternal ID of this version: | #1001026/3 |
Text MD5: | bdd77db2e5d1a1dda343ca75a5cdc018 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-04-26 12:13:02 |
Source code size: | 337 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 731 / 7637 |
Version history: | 2 change(s) |
Referenced in: | [show references] |