On Thu, Jan 29, 2009 at 8:46 PM, Steven Schveighoffer <[email protected]> wrote: > > This is such a common "mistake", and really more of an annoyance, I wonder > if it might be better if pow were switched to a template that called the > actual pow after casting the first argument to real. Often times, one does > not use reals as their variable type, and I seem to recall this kind of > error happens even with literals for both arguments... > > Something like: > > real pow(T, U)(T t, U u) > { > return _pow(cast(real)t, u); > }
That's probably how it'd be written in modern D. Most of std.math is probably 8 years old and pre-templates.
