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);

Reply via email to