Slash/fr
Deutsch · English · Français · Suomi · Русский
/
Le symbole / ou barre de fraction est utilisé dans un programme Pascal pour faire des divisions. Le résultat est une valeur réelle. Pour obtenir un entier, il faut utiliser l'opérateur div, ou les fonctions round ou trunc. Pour obtenir le reste, utilisez mod.
A := 3 / 4;renvoie 0,75 si c'est un réel (si c'est un type entier, vous obtenez une erreur de compilation:Incompatible types).
La valeur à droite ne doit pas être nulle (dénominateur), ou une erreur de division par zéro survient à l'exécution. Cependant, cette erreur peut être interceptée et traitée à l'aide d'un bloc try .. finally ou try .. except
From the Free Pascal wiki, page "Slash/fr", as it stood on 2020-02-26 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
