Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  complex.cob  Sprache: Cobol


      *   Complex Numbers in COBOL
      *   What a curiosity
         IDENTIFICATION DIVISION.
         CLASS-ID. "Complex"  Inherits SOMObject.
         ENVIRONMENT DIVISION.
         Configuration Section.
         Repository.
         CLASS SOMObject IS "SOMObject"
         CLASS UserInterface IS "UserInt" .
         DATA DIVISION.
         Working-Storage Section.
         01 Number.
           05 Real    pic s9(4)V9(4).
           05 Image   pic s9(4)V9(4).
         PROCEDURE DIVISION.
         
         IDENTIFICATION DIVISION.
         METHOD-ID. "Add" .
         DATA DIVISION.
         Working-Storage Section.
         Linkage Section.
         01 Res.
           05 Real  pic s9(4)V9(4).
           05 Image pic s9(4)V9(4).
         01 Number1.
           05 Real  pic s9(4)V9(4).
           05 Image pic s9(4)V9(4).
         01 Number2.
           05 Real  pic s9(4)V9(4).
           05 Image pic s9(4)V9(4).
         PROCEDURE DIVISION Using Number1, Number2, res.
           add Real  of Number1 Real  of Number2 giving real  of Res.
           add Image of Number1 Image of Number2 giving Image of Res.
         END METHOD "Add" .
         
         
         IDENTIFICATION DIVISION.
         METHOD-ID. "Multiply" .
         DATA DIVISION.
         Linkage Section.
         01 Res.
           05 Real  pic s9(4)V9(4).
           05 Image pic s9(4)V9(4).
         01 Number1.
           05 Real  pic s9(4)V9(4).
           05 Image pic s9(4)V9(4).
         01 Number2.
           05 Real  pic s9(4)V9(4).
           05 Image pic s9(4)V9(4).
         PROCEDURE DIVISION Using Number1, Number2, Res.
           compute Real  of Res = Real of Number1 * Real  of Number2 
                                - Image of Number1 * Image of Number2.
           compute Image of Res = Real of Number1 * Image  of Number2
                                + Image of Number1 * Real of Number2.
         END METHOD "Multiply".
         END CLASS "Complex" .

Messung
CHZG
8210010094

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-25) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,839
#Domains=906,839