|
Данная статья переведена автоматически. Наведите указатель мыши на предложения статьи, чтобы просмотреть исходный текст. Дополнительные сведения.
|
Перевод
Текст оригинала
|
sqrt, sqrtf
Visual Studio 2012
double sqrt( double x ); float sqrt( float x ); // C++ only long double sqrt( long double x ); // C++ only float sqrtf( float x );
|
|
|
|---|---|
|
|
|
// crt_sqrt.c
// This program calculates a square root.
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
double question = 45.35, answer;
answer = sqrt( question );
if( question < 0 )
printf( "Error: sqrt returns %f\n", answer );
else
printf( "The square root of %.2f is %.2f\n", question, answer );
}
Квадратный корень числа 45,35 6,73