PROPOSAL: Implicit conversions of integer literals to floating point
Don
nospam at nospam.com
Thu Dec 30 12:16:17 PST 2010
so wrote:
>> This problem has already hit Phobos. We inserted a hack so that
>> sqrt(2) will work. But exp(1) doesn't work.
>> Note that the problems really arise because we've inherited C's rather
>> cavalier approach to implicit conversion.
>
> Classifying 2 as an int was a very wrong start.
Exactly. It's not a int, it's the number two!
> This proposal reminds me my proposal on polysemous literals that i had a
> hard time explaining. (Still, i am not sure if anyone got the point)
Yes, this is far from the first time that this issue has been noticed.
More information about the Digitalmars-d
mailing list