1 | static <A> Pair<L<A>> getRandomPercent2(L<A> l, double percent) { |
2 | ret selectRandom2(l, max(0, min(l(l), iround(percent/100*l(l))))); |
3 | } |
Began life as a copy of #1008661
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1008666 |
Snippet name: | getRandomPercent2 - get a percentage of list (randomly chosen), also return rest |
Eternal ID of this version: | #1008666/3 |
Text MD5: | 47424bac1e93a1e8bf7d7371bb9fa7c3 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-05-27 14:03:56 |
Source code size: | 138 bytes / 3 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 468 / 492 |
Version history: | 2 change(s) |
Referenced in: | [show references] |