03.07.2013 Views

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

var simpleInterest:Number = 100;<br />

var continuouslyCompoun<strong>de</strong>dInterest:Number = (100 * Math.E) - principal;<br />

trace ("Beginning principal: $" + principal);<br />

trace ("Simple interest after one year: $" + simpleInterest);<br />

trace ("Continuously compoun<strong>de</strong>d interest after one year: $" +<br />

continuouslyCompoun<strong>de</strong>dInterest);<br />

//<br />

Output:<br />

Beginning principal: $100<br />

Simple interest after one year: $100<br />

Continuously compoun<strong>de</strong>d interest after one year: $171.828182845905<br />

exp (métho<strong>de</strong> Math.exp)<br />

statique publique exp(x:Number) : Number<br />

Renvoie la valeur <strong>de</strong> la base <strong>du</strong> logarithme népérien (e), à la puissance <strong>de</strong> l'exposant spécifié<br />

dans le paramètre x. La constante Math.E peut renvoyer la valeur e.<br />

Disponibilité : <strong>ActionScript</strong> 1.0 ; Flash Player 5<br />

Paramètres<br />

x:Number - L'exposant ; un nombre ou une expression.<br />

Renvoie<br />

Number - Un nombre.<br />

Exemple<br />

L'exemple suivant affiche le logarithme <strong>de</strong> <strong>de</strong>ux valeurs décimales.<br />

trace(Math.exp(1)); // output: 2.71828182845905<br />

trace(Math.exp(2)); // output: 7.38905609893065<br />

Voir également<br />

E (propriété Math.E)<br />

floor (métho<strong>de</strong> Math.floor)<br />

statique publique floor(x:Number) : Number<br />

Renvoie la valeur minimale <strong>du</strong> nombre ou <strong>de</strong> l'expression spécifié(e) dans le paramètre x. La<br />

valeur minimale est l'entier le plus proche inférieur ou égal au nombre ou à l'expression<br />

spécifié(e).<br />

Math 775

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

Saved successfully!

Ooh no, something went wrong!