summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;