Method: Math#log
- Defined in:
- math.c
#log(x) ⇒ Float (private) #log(x, base) ⇒ Float (private)
Returns the logarithm of x. If additional second argument is given, it will be the base of logarithm. Otherwise it is e (for the natural logarithm).
Domain: (0, INFINITY)
Codomain: (-INFINITY, INFINITY)
Math.log(0) #=> -Infinity
Math.log(1) #=> 0.0
Math.log(Math::E) #=> 1.0
Math.log(Math::E**3) #=> 3.0
Math.log(12, 3) #=> 2.2618595071429146
452 453 454 455 456 |
# File 'math.c', line 452
static VALUE
math_log(int argc, const VALUE *argv, VALUE unused_obj)
{
return rb_math_log(argc, argv);
}
|