freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

abs vs flabs


From: Allan Stokes
Subject: abs vs flabs
Date: Sat, 17 Mar 2001 00:10:23 -0800

Yes, Jim's comment is correct.  This is a case where C++ takes advantage of
operator overloading to define abs() separately for each of int, long,
float, double, and long double.  In C++ fabs and labs are unnecessary flesh.

Allan

> Utilities/RefCounting/RefCountedBlockPtr/RefCountedBlockPtrTest.cpp:
>
> * Change abs() to fabs() for floating point numbers.

Stroustrup says <cmath> and <math.h> are supposed to include

  double abs(double);

Is that not true.

  Jim


reply via email to

[Prev in Thread] Current Thread [Next in Thread]