Section courante

A propos

Section administrative du site

EXP

Exposant
MySQL  

Syntaxe

Exp(Nombre)

Paramètres

Nom Description
Nombre Ce paramètre permet d'indiquer l'expression contenant le nombre à traiter

Description

Cette fonction retourne la valeur exponentielle.

Algorithme

MODULE EXP(x)
   Inverse ← faux
   n ← 0
   dl ← 1
   i ← 1
   SI x < 0 ALORS
      Inverse ← vrai
      x ← -x
   FIN SI
   BOUCLE FAIRE TANT QUE x >= 2
      xx / 2
      nn + 1
   FIN BOUCLE FAIRE TANT QUE
   xx / 16
   nn + 4
   qx
   BOUCLE FAIRE TANT QUE q > 1.0E - 15
      dldl + q
      ii + 1
      qq x x / i
   FIN BOUCLE FAIRE TANT QUE
   BOUCLE POUR i ← 1 JUSQU'A n
      dldl x dl
   FIN BOUCLE POUR
   SI Inverse ALORS
      dl ← 1 / dl
   FIN SI
   RETOURNE dl

Exemple

Voici un exemple permet d'afficher les exposants inférieurs à 2 :

  1. DROP PROCEDURE IF EXISTS WHILEEXP;
  2. CREATE PROCEDURE WHILEEXP()
  3. BEGIN
  4. DECLARE R DOUBLE  DEFAULT 0.0;
  5. WHILE R < 2 DO
  6. SELECT CONCAT("Exp(",R,")=",exp(R));
  7.         SET R = R + 0.1;
  8. END WHILE;
  9. END;
  10.  
  11. CALL WHILEEXP();

on obtiendra le résultat suivant :

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0)=1 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.1)=1.10517091807565 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.2)=1.22140275816017 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.3)=1.349858807576 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.4)=1.49182469764127 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.5)=1.64872127070013 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.6)=1.82211880039051 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.7)=2.01375270747048 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.8)=2.22554092849247 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(0.9)=2.45960311115695 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1)=2.71828182845905 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.1)=3.00416602394643 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.2)=3.32011692273655 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.3)=3.66929666761924 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.4)=4.05519996684468 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.5)=4.48168907033807 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.6)=4.95303242439512 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.7)=5.4739473917272 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.8)=6.04964746441295 |
+------------------------------+

+------------------------------+
| CONCAT("Exp(",R,")=",exp(R)) |
+------------------------------+
| Exp(1.9)=6.68589444227927 |
+------------------------------+

Voir également

Article - Les géants de l'informatique - Oracle

Références

MySQL - Référence, Edition Micro Application, Nicolas Rivereau, Antoine Pichot, 2002, ISBN: 2-7429-2560-0, page 926.
MySQL: The definitive guide to using, programming, and administering MySQL 4 databases - Second Edition, Paul Dubois, 2003, ISBN: 0-7357-1212-3, page 805

Dernière mise à jour : Mercredi, le 29 avril 2015