(u_u)

crystal入門:割り切れる?:[Int] #divisible_by?(num)

Categories: [blog]
Tags: [crystal]

Int

10.divisible_by?(5) #=> true
11.divisible_by?(5) #=> false

crystal/int.cr at fbfe8b62f44eca4596090b7580801bd184f73c7a · crystal-lang/crystal

def divisible_by?(num)
    self % num == 0
end