This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Where is C++'s math.h's double abs(double)?


On Monday 02 April 2001  3:17, Gabriel Dos Reis wrote:
> There is no
>
> 	double abs(double)
>
> declared in <math.h> -- the double version in <math.h> is named "fabs".
>
> However
>
> 	double std::abs(double)
>
> is declared in <cmath>

Ah, but as I'm sure you know, according to Annex D (depreciated features) of 
the standard:

" Each C header, whose name has the form name.h, behaves as if each name 
placed in the Standard library namespace by the corresponding cname header is 
also placed within the namespace scope of the name-space std and is followed 
by an explicit using-declaration (7.3.3) 3 

[Example: The header <cstdlib> provides its declarations and definitions 
within the namespace std. The header <stdlib.h> makes these available in the 
global name space, much as in the C Standard.  end example]"

thus <math.h> should make available in the global namespace all of the 
defintions in cmath.  The default configuration doesnt do this; instead one 
must specify "--enable-cheaders=c_shadow"; however that may not bootstrap (it 
doesnt on linux-x86).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]