[Swift-user] integer division

David Kelly davidk at ci.uchicago.edu
Thu Jan 17 23:07:59 CST 2013


Hi Gwenael,

I see the same behavior in 0.93, but it looks like it has been fixed in 0.94 release candidate. The latest release candidate is http://www.ci.uchicago.edu/swift/packages/swift-0.94RC3.tar.gz. Hope this helps.

Thanks,
David


----- Original Message -----
> From: "Gwenaël Boué" <boue at oddjob.uchicago.edu>
> To: swift-user at ci.uchicago.edu
> Sent: Thursday, January 17, 2013 5:10:17 PM
> Subject: [Swift-user] integer division
> 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
> 
> 
> 
> 
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user



More information about the Swift-user mailing list