diff --git a/c/src/include/fibonacci.h b/c/src/include/fibonacci.h index ae763fc5..619d1e37 100644 --- a/c/src/include/fibonacci.h +++ b/c/src/include/fibonacci.h @@ -16,9 +16,7 @@ uintmax_t advance_fibonacci(fibonacci *fib) { return 0; } IterationHead(fib); - uintmax_t tmp = fib->a + fib->b; - fib->a = fib->b; - fib->b = tmp; + swap(fib->a, fib->b); fib->exhausted = (tmp > fib->limit); return fib->a; } diff --git a/docs/src/c/lib/bcd.rst b/docs/src/c/lib/bcd.rst index 982d332d..5049dfac 100644 --- a/docs/src/c/lib/bcd.rst +++ b/docs/src/c/lib/bcd.rst @@ -3,6 +3,12 @@ bcd.h View source code :source:`c/src/include/bcd.h` +Includes +-------- + +- `macros.h <./macros.html>`__ +- `math.h <./math.html>`__ (if compiled on PCC) + This library implements a `Binary Coded Decimal `__ object in C. Mostly this is done to prove that I could, but also because it allows for incredibly easy printing of arbitrary-sized integers. It was also a good exercise in x86 assembly, as several portions are accellerated by handcrafted assembly. diff --git a/docs/src/c/lib/digits.rst b/docs/src/c/lib/digits.rst index 15de049a..66510bb9 100644 --- a/docs/src/c/lib/digits.rst +++ b/docs/src/c/lib/digits.rst @@ -3,6 +3,13 @@ digits.h View source code :source:`c/src/include/digits.h` +Includes +-------- + +- `iterator.h <./iterator.html>`__ +- `macros.h <./macros.html>`__ +- `math.h <./math.html>`__ (if compiled on PCC) + .. c:namespace-push:: digits .. c:type:: digit_counter diff --git a/docs/src/c/lib/factors.rst b/docs/src/c/lib/factors.rst index 9fb7c72c..be762491 100644 --- a/docs/src/c/lib/factors.rst +++ b/docs/src/c/lib/factors.rst @@ -3,6 +3,12 @@ factors.h View source code :source:`c/src/include/factors.h` +Includes +-------- + +- `iterator.h <./iterator.html>`__ +- `macros.h <./macros.html>`__ (implicitly) + This file implements an :c:macro:`Iterator ` that yields proper factors for a given number. It is generally used by first calling :c:func:`proper_divisor_count` and the :c:macro:`next`/:c:macro:`next_p` functions. diff --git a/docs/src/c/lib/fibonacci.rst b/docs/src/c/lib/fibonacci.rst index 66822e08..82509d0a 100644 --- a/docs/src/c/lib/fibonacci.rst +++ b/docs/src/c/lib/fibonacci.rst @@ -3,6 +3,12 @@ fibonacci.h View source code :source:`c/src/include/fibonacci.h` +Includes +-------- + +- `iterator.h <./iterator.html>`__ +- `macros.h <./macros.html>`__ (implicitly) + .. c:namespace-push:: fibonacci .. c:type:: fibonacci diff --git a/docs/src/c/lib/iterator.rst b/docs/src/c/lib/iterator.rst index 699cccbc..e9fbfb75 100644 --- a/docs/src/c/lib/iterator.rst +++ b/docs/src/c/lib/iterator.rst @@ -3,6 +3,16 @@ iterator.h View source code :source:`c/src/include/iterator.h` +Includes +-------- + +- `macros.h <./macros.html>`__ + +Includes +-------- + +- `macros.h <./macros.html>`__ + .. c:namespace-push:: iterator .. c:macro:: IteratorHead(return_type, struct_type) diff --git a/docs/src/c/lib/math.rst b/docs/src/c/lib/math.rst index f67fc13d..22ce24f7 100644 --- a/docs/src/c/lib/math.rst +++ b/docs/src/c/lib/math.rst @@ -3,6 +3,11 @@ math.h View source code :source:`c/src/include/math.h` +Includes +-------- + +- `macros.h <./macros.html>`__ + .. c:namespace-push:: math .. c:function:: uintmax_t factorial(unsigned int n) diff --git a/docs/src/c/lib/primes.rst b/docs/src/c/lib/primes.rst index fa75770a..4c96f628 100644 --- a/docs/src/c/lib/primes.rst +++ b/docs/src/c/lib/primes.rst @@ -3,6 +3,13 @@ primes.h View source code :source:`c/src/include/primes.h` +Includes +-------- + +- `iterator.h <./iterator.html>`__ +- `macros.h <./macros.html>`__ +- `math.h <./math.html>`__ (if compiled on PCC) + .. c:namespace-push:: primes .. c:type:: prime_counter