请输入您要查询的百科知识:

 

词条 _copysign
释义

函数简介

函数原型: double _copysign( double x, double y );

所属库: float.h(属于C标准库)

函数功能: 以第二个参数y的符号(正或负)返回第一个参数x

相关函数: _chgsign

程序示例

#include <stdio.h>

#include <float.h>

int main( void )

{

double x, y;

x = y = 0.0;

scanf("%lf%lf", &x, &y);

printf("x: %f\y: %f\Result: %f\", x, y, _copysign( x, y ) );

return 0;

}

输入:

1.2 -1.2

输出:

x: 1.200000

y: -1.200000

Result: -1.200000

Press any key to continue

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/3 17:14:08