Example #1
0
        public static List <int> DeCateOriIntra(List <int> b, List <int> temp)
        {
            if (Floatz.ListIsZero(temp))
            {
                return new List <int> {
                           0
                }
            }
            ;
            temp = Floatz.ComprimaList(temp, "intreaga");
            if (Floatz.Compare2Lists(temp, b) == 1)
            {
                return new List <int> {
                           0
                }
            }
            ;
            if (Floatz.Compare2Lists(temp, b) == 0)
            {
                return new List <int> {
                           1
                }
            }
            ;


            List <int> _b = new List <int>();

            foreach (int item in b)
            {
                _b.Add(item);
            }

            List <int> i = new List <int> {
                0
            };
            int cmp = Floatz.Compare2Lists(temp, _b);

            while (cmp == -1)
            {
                i = Floatz.Add2Lists(i, new List <int> {
                    1
                });
                _b.Clear();
                _b  = Floatz.Multiply2Lists(b, i);
                cmp = Floatz.Compare2Lists(temp, _b);
            }
            if (cmp != 0)
            {
                i = Floatz.Subtract2Lists(i, new List <int> {
                    1
                });
            }
            i = ComprimaList(i);
            return(i);
        }