(浮动)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">原文:</div><div class="t-tr-dropdown-orig">(float)</div><div class="t-tr-dropdown-notes">文本通过[http://translate.google.com 谷歌翻译]机器翻译。<br/>你可以帮忙校正和验证翻译。点击[[Cppreference:MachineTranslations|此处]]查看指示。</div></div></div></div></div>, std::fabs - cppreference.com" /> std::abs<div class="t-tr-text">(浮动)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">原文:</div><div class="t-tr-dropdown-orig">(float)</div><div class="t-tr-dropdown-notes">文本通过[http://translate.google.com 谷歌翻译]机器翻译。<br/>你可以帮忙校正和验证翻译。点击[[Cppreference:MachineTranslations|此处]]查看指示。</div></div></div></div></div>, std::fabs - cppreference.com

std::abs<div class="t-tr-text">(浮动)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">原文:</div><div class="t-tr-dropdown-orig">(float)</div><div class="t-tr-dropdown-notes">文本通过[http://translate.google.com 谷歌翻译]机器翻译。<br/>你可以帮忙校正和验证翻译。点击[[Cppreference:MachineTranslations|此处]]查看指示。</div></div></div></div></div>, std::fabs

来自cppreference.com
TranslationBot留言 | 贡献2012年10月26日 (五) 14:00的版本 (Translated from the English version using Google Translate)

<metanoindex/>

 
 
 
常用数学函数
函数
基础运算
(C++11)  
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
指数函数
(C++11)
(C++11)

(C++11)
(C++11)
幂函数
(C++11)
(C++11)
三角双曲函数
(C++11)
(C++11)
(C++11)

误差与伽马函数
(C++11)
(C++11)
(C++11)
(C++11)
浮点数的最接近整数
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
浮点数操作函数
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
分类与比较
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
类型
(C++11)
(C++11)
(C++11)
宏常量
(C++11)
(C++11)
(C++26)(C++26)(C++26)

 
在标头 <cmath> 定义
float       abs( float arg );
double      abs( double arg );
long double abs( long double arg );
float       fabs( float arg );
double      fabs( double arg );
long double fabs( long double arg );
double      fabs( Integral arg );
(C++11 起)
计算一个浮点值的绝对值arg.
原文:
Computes the absolute value of a floating point value arg.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

参数

Template:param list begin Template:param list item Template:param list end

返回值

的绝对值arg|arg|
原文:
the absolute value of arg (|arg|)
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

另请参阅

Template:cpp/numeric/math/dcl list absTemplate:cpp/numeric/math/dcl list signbitTemplate:cpp/numeric/complex/dcl list absTemplate:cpp/numeric/valarray/dcl list abs