Share via


sqrt (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Calculates the square root.

double sqrt( doublex );

Parameters

  • x
    Nonnegative floating-point value.

Return Values

The sqrt function returns the square-root of x. If x is negative, sqrt returns an indefinite (same as a quiet NaN). You can modify error handling with _matherr.

Example

Description

This program calculates a square root.

Code

#include <stdlib.h>

void main( void )
{
double question = 45.35, answer;
answer = sqrt( question );
if( question < 0 )
printf( "Error: sqrt returns %.2f\n, answer" );
else
printf( "The square root of %.2f is %.2f\n", question, answer );
}
// Output
The square root of 45.35 is 6.73

Requirements

OS Versions: Windows CE 2.0 and later.

Header: stdlib.h.

Link Library: coredll.dll.

See Also

exp | log | pow

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.