コード例 #1
0
        // TODO: Still problems with method calls
        internal int DivWithHeaWithCalls(IntVal0 x, IntVal1 y)
        {
            if (y.Val <= 0)
            {
                throw new Exception();
            }

            if (x.Val <= 0)
            {
                return(0);
            }

            int z = 0;

            while (x.Val >= y.Val)
            {
                x.Val = x.Val - y.Val;
                z++;
            }

            return(z);
        }
コード例 #2
0
    // TODO: Still problems with method calls
    internal int DivWithHeaWithCalls(IntVal0 x, IntVal1 y)
    {
      if (y.Val <= 0)
        throw new Exception();

      if (x.Val <= 0)
        return 0;

      int z = 0;
      while (x.Val >= y.Val)
      {
        x.Val = x.Val - y.Val;
        z++;
      }

      return z;
    }