Bibloteca+matematica

** ** **La librería math.h ** es un archivo de cabecera de la __[|biblioteca estándar]__  del __[|lenguaje de programación C]__ esta diseñado para operaciones matemáticas básicas. Muchas de sus funciones incluyen el uso de números en __[|coma flotante]__ . __[|C++]__  también implementa estas funciones por razones de compatibilidad yeclara en la cabecera math. La biblioteca de matemáticas es relativamente fácil de usar, al igual que las vistas previamente. Se debe incluir la directiva de pre procesamiento **//#include <math.h> // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">, además de recordar de ligar la biblioteca de matemáticas al compilar: <span style="background-color: transparent; color: darkred; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">gcc progmat.c -o progmat -lm <span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">Un error común es el olvidar incluir el archivo **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: justify; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;"><math.h> // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">. <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">Una nota importante: si se está programando en C/C++ bajo Linux, y se utiliza uno de los compiladores nativos de este sistema operativo (gcc o g++), es necesario incluir, al compilar, la opción -lm, dado que, de lo contrario, el compilador generará un error. Por ejemplo, si tenemos un fichero fuente con funciones de la biblioteca matemática, llamado mi_fich_fuente_math.c, para compilarlo será necesario dar la orden siguiente en la consola de comandos de Linux: <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">$ gcc mi_fich_fuente_math.c -lm -o <nombre_del_ejecutable> <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">Esto, asimismo, no es necesario si se programa en C/C++ bajo Windows utilizando la herramienta gráfica MS Visual C++. <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">Todas las funciones en las que participan ángulos toman y devuelven <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: justify; vertical-align: auto;">__[|radianes]__ <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">. **<span style="background-color: transparent; color: #191c72; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">Funciones ****<span style="background-color: transparent; color: #191c72; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">matemática ** <span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">Se muestra a continuación una lista de funciones matemáticas. Son fáciles de usar y algunas de ellas han sido ya usadas previamente. No se proporciona ejemplo de las mismas. ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">Arco coseno || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|arco seno]__ || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|arco tangente]__ || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|arco tangente]__ <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> de dos parámetros || ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">menor <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|entero]__ <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> no menor que el parámetro || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|coseno]__ || || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|valor absoluto]__ || ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">mayor <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|entero]__ <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> no mayor que el parámetro || ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">residuo de la división de flotantes || ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">Fracciona y eleva al cuadrado. || ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">tamaño del exponente de un valor en punto flotante || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|logaritmo natural]__ || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|logaritmo]__ <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> en base 10 || ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">obtiene un valor en punto flotante íntegro y en partes || ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">eleva un valor dado a un exponente, //<span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">x<span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">y //  || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|seno]__ || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|seno hiperbólico]__ || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|raíz cuadrada]__ || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|tangente]__ || ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|tangente hiperbólica]__ || <span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: justify; text-decoration: none; vertical-align: auto;">**<span style="background-color: transparent; color: #191c72; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">Constantes matemáticas ** <span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: justify; text-decoration: none; vertical-align: auto;">La biblioteca de matemáticas define varias constantes (por lo general desechadas). Siempre es aconsejable usar estas definiciones. <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">Ejemplos: <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">El siguiente programa calcula las raíces la ecuación cuadrática ax2 + bx + c = 0 <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">#include <iostream.h>  <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">#include <stdlib.h>   <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">#include <math.h>   <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">int main <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">{ <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">PUTAS}
 * <span style="background-color: transparent; color: #ff0066; font-family: &#39;Lucida Calligraphy&#39;; font-size: 32px; text-align: justify; text-decoration: none; vertical-align: auto;">Biblioteca Matemática **
 * < <span style="background-color: transparent; color: #5f497a; display: block; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: center; text-decoration: none; vertical-align: auto;">Nombre ||< <span style="background-color: transparent; color: #5f497a; display: block; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: center; text-decoration: none; vertical-align: auto;">Descripción  ||
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|acos]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|asin]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|atan]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|atan2]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|ceil]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|cos]__ **
 * < <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; font-weight: normal; text-align: left; text-decoration: none; vertical-align: auto;">cosh ||< <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|coseno hiperbólico]__
 * < <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; font-weight: normal; text-align: left; text-decoration: none; vertical-align: auto;">exp(double x) ||< <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">función <span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|exponencial]__ <span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">, computa //<span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">e<span style="background-color: transparent; color: #5f497a; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">x  //  ||
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|abs]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|floor]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|fmod]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|frexp]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|ldexp]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|log]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|log10]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|modf]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|pow(x,y)]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|sin]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|sinh]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|sqrt]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|tan]__ **
 * < **<span style="background-color: transparent; color: #0066cc; font-family: Times New Roman; font-size: 16px; text-align: left; vertical-align: auto;">__[|tanh]__ **
 * **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: left; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">M_E // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> La base de los logaritmos naturales //<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">e //.
 * **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: left; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">M_LOG2E // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> El logaritmo de //<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">e // de base 2.
 * **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: left; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">M_LOG10E // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> El logaritmo de //<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">e // de base 10.
 * **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: left; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">M_LN2 // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> El logartimo natural de 2.
 * **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: left; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">M_LN10 // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> El logaritmo natural de 10.
 * **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: left; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">M_SQRT2 // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> La raíz cuadrada positiva de 2
 * **<span style="background-color: transparent; color: #000000; font-family: Times New Roman; font-size: 16px; text-align: left; text-decoration: none; vertical-align: auto;">//<span style="background-color: transparent; color: navy; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;">M_SQRT1_2 // **<span style="background-color: transparent; color: black; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; text-align: left; text-decoration: none; vertical-align: auto;"> La raíz cuadrada positiva de 1/2

<span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">} <span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; text-align: justify; text-decoration: none; vertical-align: auto;">Bibloteca matematica

<span style="background-color: transparent; color: #000000; font-family: &#39;Century Gothic&#39;,&#39;sans-serif&#39;; font-size: 19px; line-height: 115%; margin-bottom: 0pt; text-align: justify; text-decoration: none;">http://www.youtube.com/watch?v=IfMsf6OEPcQ