~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/ruby/simple/example.c

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2002-03-29 01:56:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020329015607-c0wt03xu8oy9ioj7
Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* File : example.c */
 
2
 
 
3
/* A global variable */
 
4
double Foo = 3.0;
 
5
 
 
6
/* Compute the greatest common divisor of positive integers */
 
7
int gcd(int x, int y) {
 
8
  int g;
 
9
  g = y;
 
10
  while (x > 0) {
 
11
    g = x;
 
12
    x = y % x;
 
13
    y = g;
 
14
  }
 
15
  return g;
 
16
}
 
17
 
 
18