This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Divisible

Divisible
yields True if n is divisible by m, and yields False if it is not.
  • Divisible works for integers or rational numbers n and m.
  • Divisible works with exact numeric quantities, as well as explicit numbers.
  • For exact numeric quantities, Divisible internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
Test whether 10 is divisible by 3:
Test whether 10 is divisible by 3:
In[1]:=
Click for copyable input
Out[1]=
Divisible works with numbers of any size:
Divisible threads itself element-wise over lists:
Symbolic forms of numeric quantities:
Rational numbers:
Gaussian integers:
Numeric quantities:
With symbolic inputs, Divisible stays unevaluated:
Select numbers that are divisible by 3:
Highlight numbers that are divisible by 3:
Show numbers that divide exactly:
Divisible is False unless is an integer:
Divisible does not automatically resolve the value:
New in 6