Skip to content
Math & Text floorDiv

$floorDiv

Integer division rounded down (towards negative infinity).

Syntax

$floorDiv[a;b]

Parameters

Parameter Description
a Dividend (integer).
b Divisor (integer, not 0).

Return Value

  • string.

Usage

$floorDiv[-3;8] → "-1"
$floorDiv[17;8] → "2"

Example

$setUserVar[block;$floorDiv[$getUserVar[x];8]]

Notes

JavaScript: bc.math.floorDiv(a, b). $divide truncates towards zero; use this one to cut a grid with negative coordinates into blocks.

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.