Standardise Guile simple example

Changes so that it works the same as other language modules
This commit is contained in:
William S Fulton 2019-02-09 14:29:34 +00:00
commit de23343739
3 changed files with 26 additions and 35 deletions

View file

@ -1,21 +1,18 @@
/* Simple example from documentation */
/* File : example.c */
#include <time.h>
/* A global variable */
double Foo = 3.0;
double My_variable = 3.0;
int fact(int n) {
if (n <= 1) return 1;
else return n*fact(n-1);
/* Compute the greatest common divisor of positive integers */
int gcd(int x, int y) {
int g;
g = y;
while (x > 0) {
g = x;
x = y % x;
y = g;
}
return g;
}
int mod(int n, int m) {
return (n % m);
}
char *get_time() {
long ltime;
time(&ltime);
return ctime(&ltime);
}