| Module | Math |
| In: |
math.c
|
| PI | = | rb_float_new(M_PI) |
| PI | = | rb_float_new(atan(1.0)*4.0) |
| E | = | rb_float_new(M_E) |
| E | = | rb_float_new(exp(1.0)) |
Returns sqrt(x**2 + y**2), the hypotenuse of a right-angled triangle with sides x and y.
Math.hypot(3, 4) #=> 5.0
ruby-doc.org is a community service provided by Happy Camper Studios, a Phoenix, Arizona, Ruby application development company.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.