English
Experimente

GGT and KGV of More as two numbers

 

p.specht

The most joint Teiler (GGT) becomes today often to the "modernen Euklidischen Algorithmus" certainly. disadvantage: The thereby using MOD-commands is in gängigen Programmiersprachen unnötigerweise on Integerzahlen dull, sodaß the Standardalgorithmus only Ganzzahhlen processing. and there the Smallest joint Vielfache (KGV) as a*b/GGT(a,b) accounts becomes, alights one then ditto always with Ganzzahlen.
an further Einschränkung lying in the usual constraint on two Parameter. what but, if the GGT or KGV of More as two Values determined go should? then helps the following Progrämmchen, that though not against To large and To small values ensured is. in the Normalfall works But.
Windowtitle "GGT and KGV of four Float-Zahlen"
(DF) demonstration-Freeware, without each Gewähr, 2013-04 by P. woodpecker
Windowstyle 1048:Randomize:Font 2
Declare a!,b!,c!,d!

While 1

    cls rnd(8^8)
    print "   first number: ";:input a!
    print "  second number: ";:input b!
    print "  Dritte number: ";:input c!
    print "  fourth number: ";:input d!
    print "-----------------------------"
    print "Ergebnis GGT = ";stature$("%g",ggt(a!,ggt(b!,ggt(c!,d!))))
    print "         KGV = ";stature$("%g",kgv(a!,kgv(b!,kgv(c!,d!))))
    waitinput

endwhile

proc ggt :parameters a!,b!

    declare h!:whilenot nearly(b!,0,11)
    h!=a!-b!*int(a!/b!):a!=b!:b!=h!
    endwhile :return a!

endproc

proc kgv :parameters a!,b!

    return a!*b!/ggt(a!,b!)

endproc

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/09/21  
 



Zum Experiment


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

369 Views

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie