Premature conversion

Hans-Eric Grönlund hasse42g at gmail.com
Wed Nov 7 02:24:43 PST 2007


The code below:

real a = 5/2;

results in the, to me, unexpected value of 2 for the variable a. What's the rationale behind this behavior? 

There are more details on my weblog:
http://www.hans-eric.com/2007/11/06/d-gotchas/

Best regards

Hans-Eric Grönlund



More information about the Digitalmars-d-learn mailing list