Sign in Join
Wiki copytemporary

Slash/fr: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-<div style="float:left; margin: 0 10px 10px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">
2-
31/
4-
5-</div>
62
73Le symbole ***/*** ou **barre de fraction** est utilisé dans un programme [[Pascal/fr|Pascal]] pour faire des divisions. Le résultat est une valeur réelle. Pour obtenir un entier, il faut utiliser l'opérateur [[Div/fr|div]], ou les fonctions [[Round/fr|round]] ou [[Trunc/fr|trunc]]. Pour obtenir le reste, utilisez [[Mod/fr|mod]].
84
95``` pascal
106 A := 3 / 4;
117```
128
139renvoie 0,75 si c'est un réel (si c'est un type entier, vous obtenez une erreur de compilation:Incompatible types).
1410
1511La 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/fr|try]] .. [[Finally/fr|finally]] ou [[Try/fr|try]] .. [[Except/fr|except]]
1612
1713---
1814*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](/wiki-contact).*

Back to history