02.05.2014 Views

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Constantes symboliques 49<br />

3.7 – Constantes symboliques<br />

L’attribut PARAMETER permet de donner un nom symbolique<br />

à une constante littérale :<br />

TYPE, PARAMETER :: n 1 =c 1 [, ..., n i =c i , ...]<br />

où n i est le nom donné à une constante et c i sa valeur.<br />

La notation suivante est aussi utilisable :<br />

PARAMETER ( n 1 =c 1 [, ..., n i =c i , ...] )<br />

Exemple<br />

PROGRAM constante<br />

LOGICAL, PARAMETER :: VRAI=.TRUE., FAUX=.FALSE.<br />

DOUBLE PRECISION :: PI, RTOD<br />

PARAMETER (PI=3.14159265d0, RTOD=180.d0/PI)<br />

...<br />

END PROGRAM constante<br />

INSTITUT DU DÉVELOPPEMENT<br />

ET DES RESSOURCES<br />

EN INFORMATIQUE SCIENTIFIQUE<br />

Cours langage Fortran – 27 janvier 2006<br />

<strong>Patrick</strong> <strong>Corde</strong> et <strong>Anne</strong> <strong>Fouilloux</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!