Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2001-11-05 12:43:32


On Monday, November 5, 2001, at 11:53 AM, Kevin Lynch wrote:

> I'm certainly willing to post something to the newsgroup along the lines
> of what I posted to the boost list; I'd certainly be willing to collect
> any suggestions other boosters have as well, and to try to present a
> more coherent version to the newsgroup that hopefully doesn't overlook
> anything of importance. Are there any other thoughts (particularly
> about math related issues) about migrating features from C99 into C++
> that people haven't posted yet? I'll wait two or three more days to see
> what pops up.

Both C90 and C99 handle integral types passed to math functions more
gracefully than does C++98. For example:

#include <math.h>

int main()
{
        double x = cos(1); // ambiguous error in C++
                         // legal C90 and C99
}

This issue is explicitly addressed under C99's description of <tgmath.h>:

Use of the macro invokes a function whose generic parameters have the
corresponding
real type determined as follows:
— First, if any argument for generic parameters has type long double,
the type
determined is long double.
— Otherwise, if any argument for generic parameters has type double or
is of integer
type, the type determined is double.
— Otherwise, the type determined is float.

Without at this time proposing a C++ solution, it would be nice if C++
also gracefully handled integral arguments to the math functions.

-Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk