Ruby Fundamentals: Understanding Integers & Floats in Ruby

preview_player
Показать описание
We work with strings a lot, but numbers are also important.

Ruby numbers are objects too.

You're going to be using two main kinds of numbers.

- Integers (-1, 0, 50_000)
- Floats (1.0, 50.0, 2.5)

In this video, you'll find:

- How these two kinds of objects work
- How to find out what kind of object you have
- How to convert integers into floats & what happens when you divide two numbers in Ruby
- What is operator precedence & what to do about it
- The #1 limitation imposed by Floating point number arithmetic, and how that can have an effect on your Ruby code

With this information, you'll make less mistakes when it comes to working with numbers in your Ruby programs.

You can learn more now by watching more of my videos, subscribing to the channel if you haven't yet & visiting my website:

Thanks for watching!
Рекомендации по теме