Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Basics Numbers Numeric Types

Faisal Husseini
Faisal Husseini
4,668 Points

how do you name the class

i am wondering of how to name the class.

program.rb
integer = 2.class
float = 2.class

1 Answer

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.