[phobos] Bug 4455: Taking sqrt of an integer

Don Clugston dclugston at googlemail.com
Tue Jul 13 14:46:27 PDT 2010


On 13 July 2010 23:25, David Simcha <dsimcha at gmail.com> wrote:
> What's wrong w/ adding sqrt(long) and sqrt(ulong) overloads that just
> forward to sqrt(real)?

Doesn't work -- it's ambiguous for ints.
 You need an explicit specialisation for every type: byte, ubyte,
short, ushort, int, uint, long, ulong.
Yuck.

  Of course that assumes sqrt(float), which is causing
> the problem in the first place, exists for a good reason.


>
> On Tue, Jul 13, 2010 at 5:18 PM, Don Clugston <dclugston at googlemail.com>
> wrote:
>>
>> On 13 July 2010 23:00, David Simcha <dsimcha at gmail.com> wrote:
>> > A related question:  Why do we even have both an sqrt(float) and an
>> > sqrt(real) in the first place?
>>
>> Don't know. Originally there was only sqrt(real).
>> As long as both exist, I don't know how sqrt(int) can be fixed cleanly.
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>


More information about the phobos mailing list