casting int to bool
nospam at nospam.com
Fri Jan 30 07:18:06 PST 2009
Steven Schveighoffer wrote:
> "Don" wrote
>> Steven Schveighoffer 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
>>> Something like:
>>> real pow(T, U)(T t, U u)
>>> return _pow(cast(real)t, u);
>> It would be better. Please create a bugzilla report, and I'll fix it.
> BTW, I assigned to the only Don in the list, not sure if that is you...
> Please fix in Tango as well if you wouldn't mind ;)
Of course. The Tango, phobos1, and phobos2 math files are a copy & paste
of each other, with a few name changes.
More information about the Digitalmars-d-learn