---
title: "fabsf 函数"
author: "cuichang"
date: "2011-06-21T00:05:18Z"
tags: []
categories: ["移动开发"]
slug: "fabsf"
draft: false
lastmod: "2011-06-21T00:05:18Z"
id: 1098904
url: "https://cuichang.iteye.com/blog/1098904"
---

返回浮点的绝对值。

 

AME

     fabs -- floating-point absolute value function

 

SYNOPSIS

     #include &lt;math.h&gt;

 

     double

     fabs(double x);

 

     long double

     fabsl(long double x);

 

     float

     fabsf(float x);

 

DESCRIPTION

     The fabs() functions compute the absolute value of a floating-point number x.

 

SPECIAL VALUES

     fabs(+-\_) returns 0.

 

     fabs(+-infinity) returns +infinity.

 

SEE ALSO

     [abs(3)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/abs.3.html#//apple_ref/doc/man/3/abs), [ceil(3)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/ceil.3.html#//apple_ref/doc/man/3/ceil), [floor(3)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/floor.3.html#//apple_ref/doc/man/3/floor), [rint(3)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/rint.3.html#//apple_ref/doc/man/3/rint), [math(3)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/math.3.html#//apple_ref/doc/man/3/math)

 

STANDARDS

     The fabs() functions conform to ISO/IEC 9899:1999(E).