Is Evenly Divisible By (Condition) — Skript

Addon: Skript · Category: Condition · Since: 2.10, 2.12 (tolerance)

Syntax

%numbers% (is|are) evenly divisible by %number% [with [a] tolerance [of] %-number%]

Description

Checks if a number is evenly divisible by another number. An optional tolerance can be provided to counteract floating point error. The default tolerance is 1e-10. Any input smaller than the tolerance is considered to be 0. This means divisors that are too small will always return false, and dividends that are too small will always return true.

Examples

if 5 is evenly divisible by 5:
if 11 cannot be evenly divided by 10:
if 0.3 can be evenly divided by 0.1 with a tolerance of 0.0000001:

View source