All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.io.ModularArithmetic Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.io;

/**
 * For compatibility
 *
 * @author Manik Surtani
 * @deprecated since 10.0
 */
@Deprecated
public class ModularArithmetic {
   public static final boolean CANNOT_ASSUME_DENOM_IS_POWER_OF_TWO = Boolean.getBoolean("infinispan.compat");

   public static final int mod(int numerator, int denominator) {
      if (CANNOT_ASSUME_DENOM_IS_POWER_OF_TWO)
         return numerator % denominator;
      else
         return numerator & (denominator - 1);
   }

   public static final long mod(long numerator, int denominator) {
      if (CANNOT_ASSUME_DENOM_IS_POWER_OF_TWO)
         return numerator % denominator;
      else
         return numerator & (denominator - 1);
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy