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 trialMatthew Delange
26,584 PointsUsing the sqrt method in the Math module, assign the value of the square root of 9 to the variable @sqrt.
I have found others that have had trouble with this challenge. I'm wondering if anyone has completed it. I have tried everything but nothing is working.
@pi = nil
@e = nil
@sqrt = nil
module Math
Math::E = @e
Math::PI = @pi
@sqrt = Math.sqrt(9)
end
3 Answers
Jennifer Nordell
Treehouse TeacherTake the sqrt line and put it after the end. It doesn't want it inside of the module. Hope this helps!
Zulèma van Gom
3,493 Points@pi = nil @e = nil @sqrt = nil
module Math Math::E = @e Math::PI = @pi Math.sqrt(9) = @sqrt end
why is this wrong?
please advice...
thank you in advance <3
Frederick Cowgill
26,293 PointsThis worked for me, hope this helps someone :)
@pi = nil @e = nil @sqrt = nil
module Math
Math::E = @e Math::PI = @pi end
@sqrt = Math.sqrt(9)
Nickolas Fuentes
14,016 PointsNickolas Fuentes
14,016 PointsThanks I was wondering why it wasn't working. Even in the question it says in the math module, which is strange.