Promotion rules ... why no float?

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 7 08:15:03 PDT 2016


On Wednesday, 7 September 2016 at 15:09:42 UTC, Lodovico Giaretta 
wrote:
> I think the current state of affairs is fairly good. Adding 
> implicit conversions would make it worst. What would probably 
> make it better (but can't be changed now) is having two 
> distinct operators, one for integer division and one with 
> implicit floating point conversions.

python3 uses / for floating point division and // for integer. I 
really like the distinction, although I would prefer if / was 
disallowed on integer operands entirely, i.e. 3/2.0 is ok but 3/2 
is not, that would be an error and you'd have to do 3 // 2


More information about the Digitalmars-d mailing list