summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <Pixel>2001-05-02 22:18:00 +0000
committerPixel <Pixel>2001-05-02 22:18:00 +0000
commit92f97b30daf39362766d445dc26f807229729d21 (patch)
tree47eee6b4d06ecc5c4b92f0ef2e84769212d6b997
parentecd16166cde1ffa3edfbaa897b049d532e234ab6 (diff)
Hop
-rw-r--r--lib/scalaires.c4
-rw-r--r--lib/terminal.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/scalaires.c b/lib/scalaires.c
index eb7b7c6..ee44304 100644
--- a/lib/scalaires.c
+++ b/lib/scalaires.c
@@ -28,6 +28,8 @@ static unsigned long long pgcd(unsigned long long a, unsigned long long b)
return pgcd(b, a % b);
}
+/* Les quelques fonctions utiles à tout le monde... Juste pour éviter de taper du code en n exemplaire */
+
rationnel rat_constr_zero(void)
{ /* renvoie 0 */
rationnel temp;
@@ -65,6 +67,8 @@ rationnel rat_constr(unsigned long long num, unsigned long long denom)
}
+/* Cette fonction est là pour faire beau. En fait, aucune routine ne l'utilise. Elle est écrite "au cas où" */
+
rationnel rat_constr_from_double(double flt)
{ /* cree une fraction a partir d un double */
return rat_constr(floor(flt * PRECISION), PRECISION);
diff --git a/lib/terminal.c b/lib/terminal.c
index 58e6851..2b13242 100644
--- a/lib/terminal.c
+++ b/lib/terminal.c
@@ -6,6 +6,11 @@
#include "config.h"
#include "exceptions.h"
+/* Quelques fonctions globales pour initialiser le terminal et en faire quelque chose
+qui ressemble aux fonctions DOS. En clair, l'interface n'a pas besoin d'attendre que l'utilisateur
+tape ENTREE pour lire une touche. De plus, dans ce mode, il n'y a pas d'écho à l'écran. Donc
+l'interface peut refaire ce qu'elle veut derrière */
+
FILE *input;
struct termios initial_settings, new_settings;