Exemple #1
0
 public static int Sqrt(long a)
 {
     if (a <= 0L)
     {
         return(0);
     }
     if (a <= (long)((ulong)-1))
     {
         return((int)IntMath.Sqrt32((uint)a));
     }
     return((int)IntMath.Sqrt64((ulong)a));
 }
Exemple #2
0
 public static long SqrtLong(long a)
 {
     if (a <= 0L)
     {
         return(0L);
     }
     if (a <= (long)((ulong)-1))
     {
         return((long)((ulong)IntMath.Sqrt32((uint)a)));
     }
     return((long)IntMath.Sqrt64((ulong)a));
 }