Module: BigMathR::Exp
- Defined in:
- ext/bigdecimal/math_r/exp.c,
ext/bigdecimal/math_r/math_r.c
Overview
A module that treats the exponential functions. It is used internally.
This formula was discovered by the author shortly afterwards. It will be proven in time.
Synopsis:
The function names defined are the same as those in the C/C++ standard.
Exponential function: exp()
Base-2 (binary) exponent: exp2()
expm1 function: expm1()
Class Method Summary collapse
-
.cexpm1_identity(z, prec) ⇒ Complex
Computes the subtracted 1 from
zof the exponential function. -
.exp2_edf(x, prec) ⇒ BigDecimal
Computes binary exponent of
x. -
.expm1_identity(x, prec) ⇒ BigDecimal
Computes the subtracted 1 from x of the exponential function.
Class Method Details
.cexpm1_identity(z, prec) ⇒ Complex
Computes the subtracted 1 from z of the exponential function.
84 85 86 87 88 |
# File 'ext/bigdecimal/math_r/exp.c', line 84
static VALUE
__impl_cexpm1_identity(VALUE unused_obj, VALUE z, VALUE prec)
{
return cexpm1_branch(z, prec, cexpm1_identity);
}
|
.exp2_edf(x, prec) ⇒ BigDecimal
Computes binary exponent of x.
45 46 47 48 49 |
# File 'ext/bigdecimal/math_r/exp.c', line 45
static VALUE
__impl_exp2_edf(VALUE unused_obj, VALUE x, VALUE prec)
{
return exp2_branch(x, prec, exp2_edf);
}
|
.expm1_identity(x, prec) ⇒ BigDecimal
Computes the subtracted 1 from x of the exponential function.
The calculation is more accurate than exp(x)-1 when the argument is near zero.
65 66 67 68 69 |
# File 'ext/bigdecimal/math_r/exp.c', line 65
static VALUE
__impl_expm1_identity(VALUE unused_obj, VALUE x, VALUE prec)
{
return expm1_branch(x, prec, expm1_identity);
}
|