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

Justin Guzman
Justin Guzman
464 Points

Stuck on this one

stuck on this one

program.rb
whole_number = 2
f = 2
p integer.integer?
p float.float?

1 Answer

Mark Sebeck
MOD
Mark Sebeck
Treehouse Moderator 37,799 Points

Hi Justin. I think you are getting mixed up with what was in the video. i suggest watching the video again. The p integer.class stuff was just to see what class was assigned. You don't need any of that. The important part is how floats and integers are determined. Its with the decimal point. i = 2 will assign 2 to the variable i and it will be type Integer. f =2.5 will assign 2.5 to the variable f and it will be type Float. So if you want to assign the value of 2 to a Float you would need to assign it a value of 2.0. So all you need is:

float =

integer =

Just add the correct values and it should pass. Keep at it Justin!

Justin Guzman
Justin Guzman
464 Points

Hey Mark, Thanks for your help I got it through! I guess I was just overthinking this one too much.