Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_round_to_multiple

(view raw script w/o annotations or w/e)
1
function round_to_multiple(arg0, arg1)
2
{
3
    if (arg1 == 0)
4
        return arg0;
5
    return round(arg0 / arg1) * arg1;
6
}
7
8
function ceil_to_multiple(arg0, arg1)
9
{
10
    if (arg1 == 0)
11
        return arg0;
12
    return ceil(arg0 / arg1) * arg1;
13
}
14
15
function floor_to_multiple(arg0, arg1)
16
{
17
    if (arg1 == 0)
18
        return arg0;
19
    return floor(arg0 / arg1) * arg1;
20
}