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
Hasan Can Terzi
5,892 Pointshow to keep real numbers in ruby
how to keep real numbers in ruby? For example, Ruby, how to keep 7.125 (real number) in memeory
1 Answer
Stone Preston
42,016 Pointsassign it to a variable
myNumber = 7.125
then you can reference it using the name of the variable
puts("The number is #{myNumber}")
Hasan Can Terzi
5,892 PointsHasan Can Terzi
5,892 PointsOk I understand it we can keep data as variable. (Sorry for bad Englih) I have exam about program languages. My language is Ruby as you can see. The question is "How is kept real numbers in your language? Show 7.125 real number in your memory." There is not much source about it. I'm confusing, ruby may be keep data as binary. I can't understand memory things. I hope I could explain my situation.