diff options
Diffstat (limited to 'include/scalaires.h')
-rw-r--r-- | include/scalaires.h | 67 |
1 files changed, 50 insertions, 17 deletions
diff --git a/include/scalaires.h b/include/scalaires.h index 5fc7dd2..7ab1951 100644 --- a/include/scalaires.h +++ b/include/scalaires.h @@ -2,30 +2,63 @@ #define __SCALAIRES_H__ typedef struct { - long long num; - unsigned long long denom; + long long num; + unsigned long long denom; } rationnel; typedef enum typedisplay { - HEX, - DEC, - OCT, - FLT + HEX, + DEC, + OCT, + FLT } typedisplay; extern typedisplay display; -rationnel rat_constr_zero(void); /* renvoie 0 */ -rationnel rat_constr(unsigned long long num, unsigned long long denom); /* cree une fraction */ -rationnel rat_constr_from_double(double flt); /* cree une fraction a partir d un double */ -void rat_destruct(rationnel rat); /* destructeur */ -double rat_to_double(rationnel rat); /* obtention du double correspondant a un rationnel */ -rationnel rat_addition(rationnel rat1, rationnel rat2); /* addition */ -rationnel rat_soustraction(rationnel rat1, rationnel rat2); /* soustraction */ -rationnel rat_moinsunaire(rationnel rat1); /* moins unaire */ -rationnel rat_multiplication(rationnel rat1, rationnel rat2); /* multiplication */ -rationnel rat_division(rationnel rat, rationnel rat2); /* division */ -rationnel rat_pow(rationnel rat, unsigned int p); /* puissance */ +rationnel rat_constr_zero(void); /* + + * renvoie 0 + */ +rationnel rat_constr(unsigned long long num, unsigned long long denom); /* + + * cree une fraction + */ +rationnel rat_constr_from_double(double flt); /* + + * cree une fraction a partir d un double + */ +void rat_destruct(rationnel rat); /* + + * destructeur + */ +double rat_to_double(rationnel rat); /* + + * obtention du double correspondant a un rationnel + */ +rationnel rat_addition(rationnel rat1, rationnel rat2); /* + + * addition + */ +rationnel rat_soustraction(rationnel rat1, rationnel rat2); /* + + * soustraction + */ +rationnel rat_moinsunaire(rationnel rat1); /* + + * moins unaire + */ +rationnel rat_multiplication(rationnel rat1, rationnel rat2); /* + + * multiplication + */ +rationnel rat_division(rationnel rat, rationnel rat2); /* + + * division + */ +rationnel rat_pow(rationnel rat, unsigned int p); /* + + * puissance + */ char *rat_to_string(rationnel rat, int first); #endif |