IBM
ibm.com › docs › en › i › 7.4.0
fabs() — Calculate Floating-Point Absolute Value
We cannot provide a description for this page right now
Programiz
programiz.com › c-programming › library-function › math.h › fabs
C fabs() - C Standard Library
The fabs() function returns the absolute value of a number.
Videos
Math Library Function ABS and FABS Function in C ...
03:02
fabs() function in Python | methods in python | function python ...
00:59
Python fabs() function | math module | mathematical functions | ...
00:46
fabs() function in c Part 183 | C Programming #coding - YouTube
03:40
Absolute Value Functions abs() And fabs() | C Programming Tutorial ...
01:26
Qlik Sense fabs function to return the absolute values | Abhishek ...
TutorialsPoint
tutorialspoint.com › c_standard_library › c_function_fabs.htm
C library - fabs() function
The C math library fabs() function accepts the parameter(x) of type double that returns the absolute value of x. This function is defined under the header that calculates the absolute value of a float point number.
GeeksforGeeks
geeksforgeeks.org › c++ › fabs-in-c
fabs() in C++ - GeeksforGeeks
January 31, 2023 - The fabs() function returns the absolute value of the argument. Mathematically |a|. If a is value given in the argument.
W3Schools
w3schools.com › c › ref_math_fabs.php
C Math fabs() Function
The fabs() function returns the absolute (positive) value of a number.
W3Schools
w3schools.com › python › ref_math_fabs.asp
Python math.fabs() Method
The math.fabs() method returns the absolute value of a number, as a float.
O'Reilly
oreilly.com › library › view › c-in-a › 0596006977 › re57.html
fabs - C in a Nutshell [Book]
December 16, 2005 - The fabs() function returns the absolute value of its floating-point argument x; if x is greater than or equal to 0, the return value is equal to x.
Authors Peter PrinzTony Crawford
Published 2005
Pages 618
Programiz
programiz.com › cpp-programming › library-function › cmath › fabs
C++ fabs() - C++ Standard Library
The fabs() function in C++ returns the absolute value of the argument.
TechOnTheNet
techonthenet.com › c_language › standard_library_functions › math_h › fabs.php
C Language: fabs function (Absolute Value of Floating-Point Number)
The fabs function returns the absolute value of a floating-point number represented by x.
Codecademy
codecademy.com › docs › c++ › math functions › fabs()
C++ (C Plus Plus) | Math Functions | fabs() | Codecademy
April 13, 2025 - The fabs() function in C++ calculates and returns the absolute value of a floating-point number. It returns the non-negative value of the input, effectively converting any negative number to its positive equivalent.
Scaler
scaler.com › home › topics › fabs() function in c
fabs() Function in C - Scaler Topics
November 7, 2023 - The fabs in C is a library function provided within the math.h header file of the C programming language.
Educative
educative.io › answers › what-is-the-fabs-function-in-cpp
What is the fabs() function in C++?
The fabs() function in C++ is used to return the absolute value of an argument passed to the function.
MKSSoftware
mkssoftware.com › docs › man3 › fabs.3.asp
fabs(), fabsf() -- floating-point absolute value function
fabs() function computes the absolute value of a floating-point number x. The · fabsf() function is a single-precision version of · fabs(). x · Is a floating point value. The · fabs() function returns the absolute value of x. If x is NaN, NaN is returned.
NCL
ncl.ucar.edu › Document › Functions › Built-in › fabs.shtml
fabs
function fabs ( value : float or double ) return_val [dimsizes(value)] : float or double
The Open Group
pubs.opengroup.org › onlinepubs › 009696899 › functions › fabs.html
fabs
Upon successful completion, these functions shall return the absolute value of x. ... If x is ±0, +0 shall be returned. If x is ±Inf, +Inf shall be returned. No errors are defined. The following sections are informative. This example shows the use of fabs() to compute the 1-norm of a vector ...
Stack Overflow
stackoverflow.com › questions › 77073189 › homemade-fabs-function-in-c-and-x86-assembly
Homemade 'fabs' function in C and x86 Assembly - Stack Overflow
#include <math.h> #include <stdio.h> typedef union { float v; struct { int mantissa : 23; int exponent : 8; int negative : 1; } b; } components; float fabs1(float f) { return f >= 0.0 ? f : -f; } float fabs2(float f) { components c; c.v = f; c.b.negative = 0; return c.v; } float fabs3(float f) { double aux = f; unsigned short cw; __asm__ ( "finit;\ fstcw %[cw];\ andw $0xf0ff, %[cw];\ orw $0x0200, %[cw];\ fldcw %[cw];\ fldl %[aux];\ fabs;\ fstpl %[aux];" : [aux] "=mr" (aux) : "m" (aux), [cw] "m" (cw) ); return aux; } void main(void) { printf("fabs(-189.55f) = %f\n", fabs(-189.55f)); printf("fabs1(-189.55f) = %f\n", fabs1(-189.55f)); printf("fabs2(-189.55f) = %f\n", fabs2(-189.55f)); printf("fabs3(-189.55f) = %f\n", fabs3(-189.55f)); } There are three different functions, one using a simple decision, one a bit more complicated using unions, and a final one using x86 assembly.