_hypot

 

Description

Calculates the hypotenuse (the longest side) of a right triangle given the two sides of the right angle

Syntax

double _hypot( double x, double y )

Parameters

x
[input] side of the right angle of a right triangle
y
[input] side of the right angle of a right triangle

Return

hypotenuse

Examples

EX1

void    _hypot_ex1()
{
    double        x = 3., y = 4.;
    double        val = _hypot(x, y);
    
    printf("_hypot(%f, %f) = %f\n", x, y, val);    // the result should be 5.
}

Remark

See Also

header to Include

origin.h

Reference