Basic Pascal Tutorial/Chapter 1/Standard Functions/fr
Sent here from Standard Functions/fr.
한국어 · Deutsch · English · Français · Български · Русский · 中文(中国) · 日本語
Tutoriel de Pascal Objet : Bases / Fonctions standards
Pascal possède plusieurs fonctions mathématiques standard que vous pouvez employer. Par exemple, pour trouver la valeur du sinus de π radians :
value := sin (3.1415926535897932);Observez que la fonction sin opère sur des angles exprimés en radians comme toutes les fonctions trigonométriques. Si tout fonctionne normalement, la valeur devrait être 0.
Les fonctions sont appelées en utilisant le nom de la fonction suivi de(s) argument(s) entre parenthèses. Les fonctions du Pascal standard comportent :
| Fonction | Description | Type de l'argument | Type de retour |
|---|---|---|---|
| abs | Valeur absolue | real or integer | comme l'argument |
| arctan | arctan en radians | real or integer | real |
| cos | cosinus d'un angle en radian | real or integer | real |
| exp | exponentielle | real or integer | real |
| ln | logarithme népérien | real or integer | real |
| round | arrondi à l'entier le plus proche | real | integer |
| sin | sinus d'un angle en radian | real or integer | real |
| sqr | Puissance 2 | real or integer | comme l'argument |
| sqrt | racine carrée | real or integer | real |
| trunc | Arrondi inférieur | real or integer | integer |
Pour les types ordinaux (integer or char), où les valeurs permises ont un successeur et un prédécesseur, vous pouvez utiliser les fonctions :
| Fonction | Description | Type de l'argument | Type de retour |
|---|---|---|---|
| chr | caractère donné par sa valeur ASCII | integer | char |
| ord | Valeur ordinale | integer or char | integer |
| pred | Prédécesseur | integer or char | comme l'argument |
| succ | Successeur | integer or char | comme l'argument |
Le type réel n'est pas un ordinal ! C'est parce qu'il n'est pas possible de dé finir précisément un successeur et un prédécesseur. Quel est le successeur de 56.0 ? Est-ce 56.1, 56.01, 56.001 ou encore 56.0001 ?
Cependant, pour l'entier 56, il y a un prédécesseur distinct — 55 — et un successeur distinct — 57.
La même chose est vraie pour les caractères :
'b'
Successeur: Succ('b') = 'c'
Prédécesseur: Pred('b') = 'a'Ce qui précède n'est pas une liste exhaustive, un compilateur moderne comporte des milliers de fonctions pour toutes sortes d'usages. Reportez-vous à la documentation de votre compilateur pour en savoir plus.
From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 1/Standard Functions/fr", as it stood on 2022-08-20 after a change by Kai Burghardt, 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.
Edited on wiki.freepascal.org by 5 people, 2014–2022
From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.
| When | Who | What changed |
|---|---|---|
| E-ric | Created page | |
| E-ric | (minor) | |
| FTurtle | ||
| Frigory | Refonte | |
| Trev | Fixed syntax highlighting (minor) | |
| Trev | Text replacement - "Object Pascal Tutorial" to "Basic Pascal Tutorial" (minor) | |
| Kai Burghardt | Kai Burghardt moved page Standard Functions/fr to Basic Pascal Tutorial/Chapter 1/Standard Functions/fr: tidy up main name space: create subpage hierarchy for basic Pascal tutorial [cf. [[Special: Per... (minor) | |
| Kai Burghardt | bypass redirects [cf. discussion] | |
| Kai Burghardt | fix previous edit [substitution not caught by regular expression because of invisible Japanese characters] (minor) | |
| Kai Burghardt | bypass language bar/categorization template redirect [cf. discussion] (minor) |
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
