Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3758

Show
Ignore:
Timestamp:
07/18/08 21:59:36 (5 months ago)
Author:
kris
Message:

fixes #1193 :: Float.truncate() exception

thanks to olaA

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/text/convert/Float.d

    r3694 r3758  
    393393{ 
    394394        auto tmp = s; 
    395         auto i = tmp.length; 
    396         foreach (idx, c; tmp) 
     395        int i = tmp.length; 
     396        foreach (int idx, T c; tmp) 
    397397                 if (c is '.') 
    398398                     while (--i >= idx) 
     
    511511                Cout.newline; 
    512512 
     513                Cout (truncate(format(tmp, 1.0, 6))).newline; 
    513514                Cout (truncate(format(tmp, 30, 6))).newline; 
    514515                Cout (truncate(format(tmp, 3.14159, 6, 0))).newline;