Programar em C/Operações matemáticas (Avançado): diferenças entre revisões

[edição não verificada][edição não verificada]
Conteúdo apagado Conteúdo adicionado
Linha 21:
===As funções <code>atan</code> e <code>atan2</code>===
 
TheAs funções <code>atan</code> functionsretornam returno thearco-tangente arctangent of theirdos arguments inem radiansradianos, ande a thefunção <code>atan2</code> functionretorna returno the arctangentarco-tangente ofde <code>y/x</code> inem radiansradianos. TheAs funções <code>atan</code> functions return aretornam valueo invalor theno rangeintervalo [-&pi;/2,+&pi;/2] (thea razão reasonpelo whyque &plusmn;&pi;/2 areestá includedincluido inno theintervalo rangeé isporque becauseos thevalores floating-pointdecimais valuepode mayrepresentar represento infinityinfinito, ande atan(&plusmn;&infin;) = &plusmn;&pi;/2); theas funções <code>atan2</code> functionsretornam returno a value invalor theno rangeintervalo [-&pi;,+&pi;]. ForPara a função <code>atan2</code>, aum "domain error" maypode occurocorrer ifse bothos argumentsdois argumentos areforem zero.
 
#include <math.h>
Linha 30:
long double atanl(long double x); /* C99 */
long double atan2l(long double y, long double x); /* C99 */
 
 
===As funções <code>cos</code>, <code>sin</code> e <code>tan</code>===