Libraryless. Click here for Pure Java version (56L/1K).
1 | static Int nullIfZero(Int i) {
|
2 | ret eq(i, 0) ? null : i; |
3 | } |
4 | |
5 | static Float nullIfZero(Float f) {
|
6 | ret eq(f, 0f) ? null : f; |
7 | } |
8 | |
9 | static Double nullIfZero(Double d) {
|
10 | ret eq(d, 0.0) ? null : d; |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1024788 |
| Snippet name: | nullIfZero |
| Eternal ID of this version: | #1024788/4 |
| Text MD5: | c80fd9636d13ef065b0e81f8b536d915 |
| Transpilation MD5: | c2a22584a27283d83c13a2766ac5322e |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-10-18 04:38:17 |
| Source code size: | 204 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 441 / 586 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |