Beispiel #1
0
 public static bool IsAdditionSafe0(int a, int b)
 {
     return(Log2Tests.Log2(a) < sizeof(int) && Log2Tests.Log2(b) < sizeof(int));
 }
 public static bool IsExponentiationSafe0(int a, int b)
 {
     return(Log2Tests.Log2(a) * b <= sizeof(int));
 }
Beispiel #3
0
 public static bool IsMultiplicationSafe0(int a, int b)
 {
     return(Log2Tests.Log2(a) + Log2Tests.Log2(b) <= sizeof(int));
 }