Module | Math |
In: |
math.c
lib/complex.rb |
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
Returns the value of flt*(2**int).
fraction, exponent = Math.frexp(1234) Math.ldexp(fraction, exponent) #=> 1234.0