diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-09-20 13:37:58 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 13:37:58 -0600 |
commit | 50785ae68e95296c9afbe62c3f50e5d9c6b71c64 (patch) | |
tree | 6bb4c2c7de18a3adb7fca1347998eeb009222787 /doc/source/f2py/code/fib3.f | |
parent | 9ebecee0a89671fc008e35c84861d4a1664ac837 (diff) | |
parent | 5126bb8f4f9178978f8ce0b4d1bb94a04e338f38 (diff) | |
download | numpy-50785ae68e95296c9afbe62c3f50e5d9c6b71c64.tar.gz |
Merge pull request #19893 from HaoZeke/f2py_docclean
MAINT,DOC: f2py restructring
Diffstat (limited to 'doc/source/f2py/code/fib3.f')
-rw-r--r-- | doc/source/f2py/code/fib3.f | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/source/f2py/code/fib3.f b/doc/source/f2py/code/fib3.f new file mode 100644 index 000000000..08b050cd2 --- /dev/null +++ b/doc/source/f2py/code/fib3.f @@ -0,0 +1,21 @@ +C FILE: FIB3.F + SUBROUTINE FIB(A,N) +C +C CALCULATE FIRST N FIBONACCI NUMBERS +C + INTEGER N + REAL*8 A(N) +Cf2py intent(in) n +Cf2py intent(out) a +Cf2py depend(n) a + DO I=1,N + IF (I.EQ.1) THEN + A(I) = 0.0D0 + ELSEIF (I.EQ.2) THEN + A(I) = 1.0D0 + ELSE + A(I) = A(I-1) + A(I-2) + ENDIF + ENDDO + END +C END FILE FIB3.F |