sqrtl与sqrtf与sqrt的区别

来源:百度知道 编辑:UC知道 时间:2024/06/08 13:19:20
不太明白 是不是结果类型不同呢? 最好说说有什么不一样 运算的类型有区别吗?

看函数的声明就知道了。

NAME
sqrt, sqrtf, sqrtl - square root function

SYNOPSIS
#include <math.h>

double sqrt(double x);
float sqrtf(float x);
long double sqrtl(long double x);

Link with -lm.

DESCRIPTION
The sqrt() function returns the non-negative square root of x. It
fails and sets errno to EDOM, if x is negative.