search (pint -w position, ulong array[], int length, int number)
    -> (byte rc = 0)
{
  int from = 0;
  int to = length;

  while ()
  {
    distance = to - from;
    middle = from + (distance_even / 2), { distance_even = distance - (distance %% 2) };

    print ("%d @ %d : %d .. %d" "\n", array[middle], middle, from, (to - 1)); 

    if (number < array[middle])
    {
      to = middle; print ("LT" "\n\n");  
    }
    else
    {
      if (number > array[middle])
      {
        from = middle + 1; print ("GT" "\n\n");  
      }
      else
      {
        *position = middle; rc = 1; print ("EQ" "\n\n");  
      }
    }

    if (rc | from >= to | from > length) break;
  }

  if (!rc) *position = 0;
}

search (pint -w position, ulong array[], int length, int number)
    if (length == 0)
    -> (byte rc = 0)
{
  *position = 0; 
}

>> ()
{
  numbers[] = { 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71 };

  print ("%d" "\n", position),
  {
    position, rc = search (&_, numbers, -_, 17)
  };
}
