Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 368 Bytes

is_divisible.md

File metadata and controls

19 lines (15 loc) · 368 Bytes
title tags
is_divisible
math,beginner

Checks if the a number is divisible by another number.

Use mod() to check if the remainder of dividing dividend by divisor is equal to 0.

function is_divisible(dividend, divisor):
  mod(dividend, divisor) == 0
end
is_divisible(42, 7) # true
is_divisible(13, 2) # false