Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/COBOL/verschiedene-Autoren/Spillner-Linz/   (verschiedene Autoren Version 0.7©)  Datei vom 13.1.2014 mit Größe 1 kB image not shown  

Quelle  gcd.cob

  Sprache: Cobol
 

      *------------------------------------------
      * berechne gcd von m und n
      * Andreas Spillner/HS-Bremen
      * Softwaretechnik Trends Band 44 Heft 4
      *------------------------------------------
       Identification Division.
       Program-Id. GCD.
       Author. NN.
       Data Division.
       Working-Storage Section.
         77 r           pic 9(4).
       Linkage Section.
         77 n           pic 9(4).
         77 m           pic 9(4).
         77 result      pic 9(4).
       Procedure Division using x, y, z returning result.
      * Beispiel mit Fehler!
      *
      * pre: m>0 and n>0
      * post: return >0 and
      * m@pre.mod(return) = 0 and
      * ...
        if n>m then
          move m to r
          move n to m
          move r to n
        end-if
        move function mod(m,n) to r
        perform until r not0 with test before
          move m to r
          move n to m
          move r to n
        end-perform
        move n to result
      * result wird zurückgegeben
       End-Program GCD.

Messung V0.5 in Prozent
C=67 H=100 G=84

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-06-14) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.