We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6208387 commit 0042d17Copy full SHA for 0042d17
examples/c_extension_example/src/lib.c
@@ -29,10 +29,12 @@ fib(PyObject *self, PyObject *args)
29
30
int previous = 1;
31
int current = 1;
32
+ int temp;
33
while (current < limit)
34
{
35
+ temp = current;
36
current = current + previous;
- previous = current;
37
+ previous = temp;
38
39
// "Box" The current value to convert it to a Python int, then append it to the numbers Python list.
40
PyObject *newElement = PyLong_FromLong(current);
0 commit comments