1 | static int signWithThreshold(double x, double threshold) { |
2 | if (threshold == 0 ? x == 0.0 : Math.abs(x) < threshold) ret 0; |
3 | ret x < 0 ? -1 : 1; |
4 | } |
Began life as a copy of #1005824
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005825 |
Snippet name: | signWithThreshold - like sign, but return 0 if absolute value below threshold |
Eternal ID of this version: | #1005825/1 |
Text MD5: | f2e4c48658d7d7baa1c1e56a2143bbd8 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-12-10 17:08:57 |
Source code size: | 151 bytes / 4 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 477 / 510 |
Referenced in: | [show references] |