1 | static float varyFloat(float x) { |
2 | ret tossCoin() |
3 | ? (float) random(max(x-0.1, 0), x) |
4 | : (float) random(x, min(x+0.1, 1)); |
5 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018846 |
Snippet name: | varyFloat - zero to one by default |
Eternal ID of this version: | #1018846/3 |
Text MD5: | 1400655ed02465c8da924441af438941 |
Author: | stefan |
Category: | javax / random |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-14 12:58:40 |
Source code size: | 135 bytes / 5 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 336 / 401 |
Version history: | 2 change(s) |
Referenced in: | [show references] |