integer division with float result

Lionello Lunesu lio at lunesu.remove.com
Mon Nov 19 23:39:43 PST 2007


> void divide(in T numerator, in T denominator, out T result) 
> 
> and
> 
> T divide(in T numerator, in T denominator)
> 
> where T = any numeric type
> 
> So why do we still insist on it in modern languages?

Have to agree with Bruce on this one.

In fact, perhaps D could do something similar to that array trick (void 
bla(T[]); T[] ar; ar.bla;) for the return value of a function: void 
bla(out T); T t = bla;

(Isn't that similar to what the return value optimization does, by the way?)

L.



More information about the Digitalmars-d mailing list