[Swift-user] floor(), ceil() and round() issues with v0.8.0

Justin M Wozniak wozniak at mcs.anl.gov
Mon Jul 27 10:49:32 CDT 2015


These fixes are on the web now.

On 07/27/2015 04:10 AM, Timothy Stitt (TGAC) wrote:
> Thanks Tim.
>
> I don't think those changes made their way into the v0.8.0 user guide 
> that I have with my distribution.  Your suggestion did work though and 
> my old script is now compiling again.
>
> Cheers.
>
> ---
>
> *Timothy Stitt PhD* / Head of Scientific Computing
>
> The Genome Analysis Centre (TGAC), Room 204b
>
> http://www.tgac.ac.uk/
>
>
> p: +44 1603 450378
>
> e: timothy.stitt at tgac.ac.uk <mailto:timothy.stitt at tgac.ac.uk>
>
>
> From: Tim Armstrong <tim.g.armstrong at gmail.com 
> <mailto:tim.g.armstrong at gmail.com>>
> Date: Monday, 27 July 2015 00:18
> To: Timothy Stitt <timothy.stitt at tgac.ac.uk 
> <mailto:timothy.stitt at tgac.ac.uk>>
> Cc: "swift-user at ci.uchicago.edu <mailto:swift-user at ci.uchicago.edu>" 
> <swift-user at ci.uchicago.edu <mailto:swift-user at ci.uchicago.edu>>
> Subject: Re: [Swift-user] floor(), ceil() and round() issues with v0.8.0
>
>     Hi Tim,
>       The return type of those functions changed to float in 0.8.0 as
>     part of a bigger effort to standardise the Swift library.  We
>     tried to keep things backwards compatible as much as possible but
>     unfortunately there wasn't a way to do that in this case.
>
>     You can get the same effect with toInt(floor(7.8))
>
>     - Tim
>
>     On 26 July 2015 at 12:59, Timothy Stitt (TGAC)
>     <Timothy.Stitt at tgac.ac.uk <mailto:Timothy.Stitt at tgac.ac.uk>> wrote:
>
>         Dear Swift/T developers & users,
>
>         I've been recompiling a Swift/T script in v0.8.0 (which worked
>         in previous versions) but its failing to compile at the line
>         involving the floor() command. The error I'm seeing is:
>
>         stc error:
>         test.swift:7:6: Cannot assign to t: LVal has type int but RVal
>         has type float
>
>         I know that this worked fine in previous versions so I tried
>         to compile with the trivial example below and I get the same
>         error:
>
>         import math;
>         import io;
>         import sys;
>
>         main
>         {
>          int t = floor(7.8);
>          trace(t);
>         }
>
>         I substituted floor() for ceil() and round() and got the same
>         error. Is there something wrong with the math library or am I
>         doing something really stupid that I can't see.
>
>         Thanks,
>
>         Tim.
>
>         ---
>
>         *Timothy Stitt PhD* / Head of Scientific Computing
>
>         The Genome Analysis Centre (TGAC), Room 204b
>
>         http://www.tgac.ac.uk/
>
>
>         p: +44 1603 450378 <tel:%2B44%201603%20450378>
>
>         e: timothy.stitt at tgac.ac.uk <mailto:timothy.stitt at tgac.ac.uk>
>
>
>         _______________________________________________
>         Swift-user mailing list
>         Swift-user at ci.uchicago.edu <mailto:Swift-user at ci.uchicago.edu>
>         https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user
>
>
>
>
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user


-- 
Justin M Wozniak

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20150727/b2ddb8e0/attachment.html>


More information about the Swift-user mailing list