Where are std::sinf( float ) etc.

Ed Smith-Rowland 3dw4rd@verizon.net
Fri Dec 30 00:42:00 GMT 2005


I'm sorry if my imprecise language got things off to a rocky start.

I was looking towards section 8 of TR1 and looking over where we were 
and what was left to do.  During the course of these investigations I 
was looking over how the standard library currently implements these 
functions.  I was surprised to see some of the TR1 items such as math 
function overloads and fpclassify and like template functions already 
implemented.  Now I understand the history (these were user-requested 
enhancements) and are separate from TR1 (although potentially useful).

My suggestion was NOT to add TR1 math functions to c_std/std_cmath.h but 
rather to create a new tr1/std_cmath.h with the TR1 math functions and 
all the overloads in a manner very similar to what is in 
c_std/std_cmath.h but in a separate location and under namespace 
std::tr1::. This left me with some questions:

   1. Given that some math functions from TR1 and the templates for
      fpclassify, isnan, etc. are already in as enhancemets should we
      either check off those parts of TR1 as "done" with a note in the
      manual that they are NOT in std::tr1:: but in std:: OR should we
      go ahead and re-implement those functions in a tr1/std_cmath.h and
      under std::tr1.  I guess I'm in favor of the latter.  Also,
      removing the existing enhancements would cause a lot of
      unnecessary heartache for the people that wanted tem in te first
      place.  It is very likely that they won't be extensions for much
      longer anyway.
   2. Where were the suffixed math functions?  Given the insistence in
      TR1 for suffixed versions of the new math functions in addition to
      the overloads I had assumed that the current standard required the
      current math functions to be available in suffixed versions.  Some
      sentence in the latest C++ draft left me with the impression that
      these were supposed to be in but I can't find what I was looking
      for now.  Anyway, I was evidently wrong although that would seem
      to me to imply that TR1 is either incomplete or inconsistent in
      this regard.

I hope this clarifies my earlier message.

Thanks,

Ed Smith-Rowland




More information about the Libstdc++ mailing list