summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorPaul Jungeblut <s_jungeb@i08pc58.atis-stud.uni-karlsruhe.de>2014-11-11 15:25:06 +0100
committerPaul Jungeblut <s_jungeb@i08pc58.atis-stud.uni-karlsruhe.de>2014-11-11 15:25:06 +0100
commit1d2d2541dd913892a983da13f84c33f1a5d43ff6 (patch)
tree0d966ee6cfac16d0c0f7143dbcff650b40679279 /math
parent6fab6269e313b9486e5fd940356d5e9e73c3b4b3 (diff)
geometrische Formeln
Diffstat (limited to 'math')
-rw-r--r--math/binomial.cpp14
-rw-r--r--math/math.tex4
2 files changed, 7 insertions, 11 deletions
diff --git a/math/binomial.cpp b/math/binomial.cpp
index afc9800..61d9d69 100644
--- a/math/binomial.cpp
+++ b/math/binomial.cpp
@@ -1,15 +1,7 @@
-#include <iostream>
-
-using namespace std;
-
-
-unsigned long long calc_binom(unsigned long long N, unsigned long long K)
-{
- unsigned long long r = 1;
- unsigned long long d;
+ll calc_binom(ll N, ll K) {
+ ll r = 1, d;
if (K > N) return 0;
- for (d = 1; d <= K; d++)
- {
+ for (d = 1; d <= K; d++) {
r *= N--;
r /= d;
}
diff --git a/math/math.tex b/math/math.tex
new file mode 100644
index 0000000..e1e0950
--- /dev/null
+++ b/math/math.tex
@@ -0,0 +1,4 @@
+\section{Mathe}
+
+\subsection{Binomialkoeffizienten}
+\lstinputlisting{math/binomial.cpp} \ No newline at end of file