Slash/fr: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | 1 | / | |
| 4 | - | ||
| 5 | - | ||
| 6 | 2 | ||
| 7 | 3 | Le 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]]. | |
| 8 | 4 | ||
| 9 | 5 | ``` pascal | |
| 10 | 6 | A := 3 / 4; | |
| 11 | 7 | ``` | |
| 12 | 8 | ||
| 13 | 9 | renvoie 0,75 si c'est un réel (si c'est un type entier, vous obtenez une erreur de compilation:Incompatible types). | |
| 14 | 10 | ||
| 15 | 11 | 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/fr|try]] .. [[Finally/fr|finally]] ou [[Try/fr|try]] .. [[Except/fr|except]] | |
| 16 | 12 | ||
| 17 | 13 | --- | |
| 18 | 14 | *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).* |
