Libraryless. Click here for Pure Java version (48L/1K).
static int roundUpTo(int n, int x) { return (x+n-1)/n*n; } static long roundUpTo(long n, long x) { return (x+n-1)/n*n; } static double roundUpTo(double n, double x) { return floor((x+n-1)/n)*n; }
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: | #1001008 |
Snippet name: | roundUpTo - unintuitive argument order |
Eternal ID of this version: | #1001008/5 |
Text MD5: | b8e3a86691a7d9c95ccd05b805343a55 |
Transpilation MD5: | 25a8586200d01a38cc599650bfb8230b |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-10-10 20:30:46 |
Source code size: | 213 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 741 / 1104 |
Version history: | 4 change(s) |
Referenced in: | #1002427 - Accellerating 629 (SPIKE) #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1013672 - roundDownTo - unintuitive argument order #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |