![]() You can use the modulo to check if a number is divisible by another.Ī number is divisible if the remaining is 0. Let’s explore more uses! Practical Uses For The Modulo Operator In Ruby, we have the even?/ odd? methods.īut if you want to check if a number is divisible by 3, then you have to use the modulo operator. This can be used for things like checking if a number is even or odd. The modulo operator gives you the remaining of a division. The Ruby modulo operator looks like this: You’ll learn how to apply these concepts in Ruby, so this is going to be a practical guide. If you’re just going to be writing CRUD apps all day then you probably don’t need to know much math, if any.īut if you want to do more interesting things, like solving coding challenges & be prepared for coding interviews then learning a few basic concepts is helpful. ![]() Do you need to know math to become a good programmer?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |