[Swift-user] integer division
Gwenaël Boué
boue at oddjob.uchicago.edu
Thu Jan 17 17:10:17 CST 2013
Hi,
I did this small script:
--------------------------------------------------------------
int n = 7 %/ 5; // expect n = 1
float x = 1.0*@tofloat(n); // expect x = 1.0
string msg = @strcat("x = ", x);
trace(msg);
--------------------------------------------------------------
I expected to see "x = 1.0", but I got "x = 1.4". Is it normal ?
Gwenael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20130117/9791ed49/attachment.html>
More information about the Swift-user
mailing list