Promotion rules ... why no float?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 6 13:51:00 PDT 2016


On Tuesday, 6 September 2016 at 07:52:47 UTC, Daniel Kozak wrote:
> No, it is really important rule. If there will be automatic 
> promotion to float for auto it will hurt performance
> in cases when you want int and it will break things.
>

The performance have nothing to do with it. In fact float 
division is way faster than integer division, try it. It is all 
about correctness. Integer and floating point division have 
different semantic.



More information about the Digitalmars-d mailing list