// TODO: optimize to x-(x%n) in case that's the same thing // (or x-mod(x,n)?) static int roundDownTo(int n, int x) { return x/n*n; } static long roundDownTo(long n, long x) { return x/n*n; } static double roundDownTo(double n, double x) { return floor(x/n)*n; }
Began life as a copy of #1001008
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1013672 |
| Snippet name: | roundDownTo - unintuitive argument order |
| Eternal ID of this version: | #1013672/5 |
| Text MD5: | 221efe77d9e0ce004b716c8436901579 |
| Author: | stefan |
| Category: | |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-12-07 21:46:34 |
| Source code size: | 282 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 759 / 1577 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |