Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
mir.math.internal.log_binomial
License:
Authors:
John Michael Hall
- T
logFactorial
(T = double)(ulongcount
, ulongstart
= 1)
if (isFloatingPoint!T); - Examples:
import mir.math.common: approxEqual, log; assert(logFactorial(0) == 0); assert(logFactorial(1) == 0); assert(logFactorial(2).approxEqual(log(1.0 * 2))); assert(logFactorial(3).approxEqual(log(1.0 * 2 * 3))); assert(logFactorial(4).approxEqual(log(1.0 * 2 * 3 * 4))); assert(logFactorial(5).approxEqual(log(1.0 * 2 * 3 * 4 * 5)));
- T
logBinomialCoefficient
(T = double)(ulongn
, uintk
)
if (isFloatingPoint!T); - Examples:
import mir.bignum.fp: Fp, fp_log; import mir.math.numeric: binomialCoefficient; import mir.math.common: approxEqual, log; assert(logBinomialCoefficient(5, 1).approxEqual(log(5.0))); assert(logBinomialCoefficient(5, 2).approxEqual(fp_log!double(binomialCoefficient(5, 2)))); assert(logBinomialCoefficient(5, 3).approxEqual(fp_log!double(binomialCoefficient(5, 3)))); assert(logBinomialCoefficient(5, 4).approxEqual(fp_log!double(binomialCoefficient(5, 4))));
Copyright © 2016-2023 by Ilya Yaroshenko | Page generated by
Ddoc on Wed Oct 18 12:23:04 2023