Ejemplo n.º 1
0
 private static ulong CalculateRemainder2(
     ulong group2,
     ulong group3,
     ulong group4,
     ulong group5)
 {
     return((ulong)((double)((ulong)((double)((ulong)((double)NumericMode.CalculateRemainder5(group2) * Math.Pow(10.0, 10.0) + (double)group3) % 900UL) * Math.Pow(10.0, 10.0) + (double)group4) % 900UL) * Math.Pow(10.0, 10.0) + (double)group5) % 900UL);
 }
Ejemplo n.º 2
0
        private static List <ulong> Remainder(string values)
        {
            List <ulong> ulongList = new List <ulong>();

            if (values.Length <= 10)
            {
                ulong group5     = ulong.Parse(values);
                ulong remainder5 = NumericMode.CalculateRemainder5(group5);
                ulongList.Add(group5);
                ulongList.Add(remainder5);
            }
            else if (values.Length <= 20)
            {
                ulong group4     = ulong.Parse(values.Substring(0, values.Length - 10));
                ulong group5     = ulong.Parse(values.Substring(values.Length - 10));
                ulong remainder4 = NumericMode.CalculateRemainder4(group4, group5);
                ulongList.Add(group5);
                ulongList.Add(group4);
                ulongList.Add(remainder4);
            }
            else if (values.Length <= 30)
            {
                ulong group3     = ulong.Parse(values.Substring(0, values.Length - 20));
                ulong group4     = ulong.Parse(values.Substring(values.Length - 20, 10));
                ulong group5     = ulong.Parse(values.Substring(values.Length - 10));
                ulong remainder3 = NumericMode.CalculateRemainder3(group3, group4, group5);
                ulongList.Add(group5);
                ulongList.Add(group4);
                ulongList.Add(group3);
                ulongList.Add(remainder3);
            }
            else if (values.Length <= 40)
            {
                ulong group2     = ulong.Parse(values.Substring(0, values.Length - 30));
                ulong group3     = ulong.Parse(values.Substring(values.Length - 30, 10));
                ulong group4     = ulong.Parse(values.Substring(values.Length - 20, 10));
                ulong group5     = ulong.Parse(values.Substring(values.Length - 10));
                ulong remainder2 = NumericMode.CalculateRemainder2(group2, group3, group4, group5);
                ulongList.Add(group5);
                ulongList.Add(group4);
                ulongList.Add(group3);
                ulongList.Add(group2);
                ulongList.Add(remainder2);
            }
            else
            {
                ulong group1     = ulong.Parse(values.Substring(0, values.Length - 40));
                ulong group2     = ulong.Parse(values.Substring(values.Length - 40, 10));
                ulong group3     = ulong.Parse(values.Substring(values.Length - 30, 10));
                ulong group4     = ulong.Parse(values.Substring(values.Length - 20, 10));
                ulong group5     = ulong.Parse(values.Substring(values.Length - 10));
                ulong remainder1 = NumericMode.CalculateRemainder1(group1, group2, group3, group4, group5);
                ulongList.Add(group5);
                ulongList.Add(group4);
                ulongList.Add(group3);
                ulongList.Add(group2);
                ulongList.Add(group1);
                ulongList.Add(remainder1);
            }
            return(ulongList);
        }