Ruby Ruby Basics Numbers Numeric Types

Faisal Husseini
Faisal Husseini
3,523 Points

how do you name the class

i am wondering of how to name the class.

integer = 2.class
float = 2.class

1 Answer

54,288 Points

You won't need to name a class. The challenge wants you to assign 2 to variables named integer and float. The value assigned to integer needs to have a class of Integer. The value assigned to float needs to have a class of Float

From the teacher's notes

If the number in your code has a decimal point, it's a Float. Otherwise, it's a Fixnum/Integer.

So when assigning 2 to float you will need to include a decimal point.