PROPOSAL: Implicit conversions of integer literals to floating point

so so at so.do
Thu Dec 30 08:24:27 PST 2010


> 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.
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)


More information about the Digitalmars-d mailing list