30 Sep
2005
30 Sep
'05
2:16 p.m.
On Sep 29, 2005, at 10:11 AM, Andy Little wrote:
Hi,
In Mathematical Special Functions, why are the functions not template specialisations?
At the risk of being irritating, I'm going to ask just the opposite question. ;-) Why is hypot (for example) templated? template <class T> T hypot(T x, T y); If the intent is to implement 8.16.4 (from N1836), I don't think this does it. Consider this test for example: double x = hypot(99., 20); assert(x == 101.); Or this one: double x = hypot(99, 20); assert(x == 101.); Or <gag> this one: double x = hypot(float(99), char(20)); assert(x == 101.); Also do we want to support infinities and nans? assert(hypot(INFINITY, sqrt(-1.)) == INFINITY); -Howard