Module: BigMathR::Log
- Defined in:
- ext/bigdecimal/math_r/math_r.c
Class Method Summary collapse
-
.clog10_formula(z, prec) ⇒ Complex
Computes complex common logarithm of
z. -
.clog2_formula(z, prec) ⇒ Complex
Computes complex binary logarithm of
z. -
.clog_formula(z, prec) ⇒ Complex
Computes complex natural logarithm of
z. -
.log10_edf(x, prec) ⇒ BigDecimal
Computes common logarithm of
x. -
.log1p_p_adic(x, prec) ⇒ Complex
Computes p-adic logarithm of
x. -
.log1p_ser_mercator(x, prec) ⇒ Complex
Computes natural logarithm of x 1+ by mercator series expansion.
-
.log2_edf(x, prec) ⇒ BigDecimal
Computes binary logarithm of
x. -
.log_edf(x, prec) ⇒ BigDecimal
Computes natural logarithm of
x. -
.log_ser_okumura(x, prec) ⇒ BigDecimal
Computes natural logarithm of
xby series expansion.
Class Method Details
.clog10_formula(z, prec) ⇒ Complex
Computes complex common logarithm of z.
220 221 222 223 224 |
# File 'ext/bigdecimal/math_r/log.c', line 220 static VALUE __impl_clog10_formula(VALUE unused_obj, VALUE z, VALUE prec) { return clog10_branch(z, prec, clog10_formula); } |
.clog2_formula(z, prec) ⇒ Complex
Computes complex binary logarithm of z.
201 202 203 204 205 |
# File 'ext/bigdecimal/math_r/log.c', line 201 static VALUE __impl_clog2_formula(VALUE unused_obj, VALUE z, VALUE prec) { return clog2_branch(z, prec, clog2_formula); } |
.clog_formula(z, prec) ⇒ Complex
Computes complex natural logarithm of z.
182 183 184 185 186 |
# File 'ext/bigdecimal/math_r/log.c', line 182 static VALUE __impl_clog_formula(VALUE unused_obj, VALUE z, VALUE prec) { return clog_branch(z, prec, clog_formula); } |
.log10_edf(x, prec) ⇒ BigDecimal
Computes common logarithm of x.
In terms of solving real number solutions, the implementation is the same as log10() in C.
163 164 165 166 167 |
# File 'ext/bigdecimal/math_r/log.c', line 163 static VALUE __impl_log10_edf(VALUE unused_obj, VALUE x, VALUE prec) { return log10_branch(x, prec, log10_edf); } |
.log1p_p_adic(x, prec) ⇒ Complex
Computes p-adic logarithm of x.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'ext/bigdecimal/math_r/log.c', line 56 static VALUE __impl_log1p_p_adic(VALUE uunused_obj, VALUE x, VALUE prec) { const ID cover_p = rb_intern("cover?"); VALUE domain = rb_range_new(INT2FIX(-1), INT2FIX(1), false); if (RTEST(rb_funcall(domain, cover_p, 1, x))) { if (rb_num_equal_p(x, INT2FIX(-1))) return BIG_MINUS_INF; else if (rb_num_equal_p(x, INT2FIX(1))) return rb_bigmath_const_log2(prec); else return log1p_p_adic(x, prec); } else return BIG_NAN; } |
.log1p_ser_mercator(x, prec) ⇒ Complex
Computes natural logarithm of x 1+ by mercator series expansion.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'ext/bigdecimal/math_r/log.c', line 25 static VALUE __impl_log1p_ser_mercator(VALUE uunused_obj, VALUE x, VALUE prec) { const ID cover_p = rb_intern("cover?"); VALUE domain = rb_range_new(INT2FIX(-1), INT2FIX(1), false); if (RTEST(rb_funcall(domain, cover_p, 1, x))) { if (rb_num_equal_p(x, INT2FIX(-1))) return BIG_MINUS_INF; else if (rb_num_equal_p(x, INT2FIX(1))) return rb_bigmath_const_log2(prec); else return log1p_ser_mercator(x, prec); } else return BIG_NAN; } |
.log2_edf(x, prec) ⇒ BigDecimal
Computes binary logarithm of x.
In terms of solving real number solutions, the implementation is the same as log2() in C.
144 145 146 147 148 |
# File 'ext/bigdecimal/math_r/log.c', line 144 static VALUE __impl_log2_edf(VALUE unused_obj, VALUE x, VALUE prec) { return log2_branch(x, prec, log2_edf); } |
.log_edf(x, prec) ⇒ BigDecimal
Computes natural logarithm of x.
In terms of solving real number solutions, the implementation is the same as log() in C.
125 126 127 128 129 |
# File 'ext/bigdecimal/math_r/log.c', line 125 static VALUE __impl_log_edf(VALUE unused_obj, VALUE x, VALUE prec) { return log_branch(x, prec, log_edf); } |
.log_ser_okumura(x, prec) ⇒ BigDecimal
Computes natural logarithm of x by series expansion.
106 107 108 109 110 |
# File 'ext/bigdecimal/math_r/log.c', line 106 static VALUE __impl_log_ser_okumura(VALUE uunused_obj, VALUE x, VALUE prec) { return log_branch(x, prec, log_ser_okumura); } |