CTFE Status 2

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 2 23:15:44 PDT 2017


On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:
> [ ... ]

Hi Guys,

I am very pleased indeed about the following code now running in 
ctfe.

int maxFloat()
{
   float prev = 0;
   float fOne = 1;
   foreach(int i; 1 .. int.max)
   {
     if (i == prev)
       return i-1;
     else
       prev += fOne;
   }
   return int.max;
}

static assert(maxFloat() == 16777216);



More information about the Digitalmars-d mailing list