File: GGD.algorithm

package info (click to toggle)
c%2B%2B-annotations 8.2.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,804 kB
  • ctags: 2,845
  • sloc: cpp: 15,418; makefile: 2,473; ansic: 165; perl: 90; sh: 29
file content (45 lines) | stat: -rw-r--r-- 1,638 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From d.j.heijs@wing.rug.nl  Tue Jan 30 02:10:13 2001
Received: from oosix.icce.rug.nl (root@oosix.icce.rug.nl [129.125.14.80])
	by suffix.icce.rug.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id CAA11404
	for <frank@suffix.icce.rug.nl>; Tue, 30 Jan 2001 02:10:13 +0100
Received: from dep.cpedu.rug.nl (dep.cpedu.rug.nl [129.125.28.200])
	by oosix.icce.rug.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id CAA25169
	for <frank@icce.rug.nl>; Tue, 30 Jan 2001 02:10:15 +0100
Received: from skylos (client44-109.kabelA.oprit.rug.nl [129.125.44.109])
	by dep.cpedu.rug.nl (8.9.3/8.9.3/Debian 8.9.3-21) with SMTP id CAA31441
	for <frank@icce.rug.nl>; Tue, 30 Jan 2001 02:10:13 +0100
X-Authentication-Warning: dep.cpedu.rug.nl: Host client44-109.kabelA.oprit.rug.nl [129.125.44.109] claimed to be skylos
Message-ID: <000701c08a59$d376baf0$0201a8c0@skylos>
From: "Dirk-Jan Heijs" <d.j.heijs@wing.rug.nl>
To: <frank@icce.rug.nl>
Subject: Gave ggd functie
Date: Tue, 30 Jan 2001 02:13:16 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Status: ROr

Hoi Frank,
gisteren hoorde ik van een vriend een mooie functie 
om de grootste gemene deler van twee getallen uit 
te rekenen (het grootste getal waardoor beide 
getallen deelbaar zijn).
Hier is hij:

// Copyright by Gerton Lunter
int ggd(int a, int b)
{
  while(a ^= b ^= a ^= b %= a);
  return(b);
}
// Copyright by Gerton Lunter

Gaaf he? (Heb je er nog leuk commentaar op?)
Groetjes,
Dirk-Jan