floating point divide

Damian damianday at hotmail.co.uk
Thu Oct 11 07:29:37 PDT 2012


I come from a pascal background and we could use:
div    integral division operator
/      floating point division operator

So my question is, how does D force floating point division on 
integrals?
At the moment i do this, but i was hoping for an easier way:

int n1 = 10, n2 = 2;
float f = cast(float)(cast(float)(n1 / n2));


More information about the Digitalmars-d-learn mailing list