public int reset () { low = min; high = max; current = (low + high) >>> 1; if (pot) return (int)Math.pow(2, current); if (mod4) return current % 4 == 0 ? current : current + 4 - (current % 4); return current; }
public Exp (float value, float power) { this.value = value; this.power = power; min = (float)Math.pow(value, -power); scale = 1 / (1 - min); }
public Exp (float value, float power) { this.value = value; this.power = power; min = (float)Math.pow(value, -power); scale = 1 / (1 - min); }
public int reset () { low = min; high = max; current = (low + high) >>> 1; if (pot) return (int)Math.pow(2, current); if (mod4) return current % 4 == 0 ? current : current + 4 - (current % 4); return current; }
public static String humanReadableByteCount(long bytes, boolean si) { int unit = si ? 1000 : 1024; if (bytes < unit) return bytes + " B"; int exp = (int) (Math.log(bytes) / Math.log(unit)); String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp-1) + (si ? "" : "i"); return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre); }
public static double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); long factor = (long) Math.pow(10, places); value = value * factor; long tmp = Math.round(value); return (double) tmp / factor; }
private static int parseInt(String version) { int v = 0; String[] vArr = version.split("\\."); int len = vArr.length; for (int i = 0; i < len; i++) { v += Integer.parseInt(getDigital(vArr[i])) * Math.pow(10, (len - i - 1) * 2); } return v; }
private static int parseInt(String version) { int v = 0; String[] vArr = version.split("\\."); int len = vArr.length; for (int i = 0; i < len; i++) { v += Integer.parseInt(getDigital(vArr[i])) * Math.pow(10, (len - i - 1) * 2); } return v; }
public float apply (float a) { if (a == 0) return 0; a = 1 - a; return (1 - (float)Math.pow(value, power * (a - 1)) * MathUtils.sin(a * bounces) * scale); } }
public float apply (float a) { if (a >= 0.99) return 1; return (float)Math.pow(value, power * (a - 1)) * MathUtils.sin(a * bounces) * scale; } }
public static Histogram makeHistogram(int rangeCount) { long[] rangeValues = new long[rangeCount]; for (int i = 0; i < rangeValues.length; ++i) { rangeValues[i] = (long) Math.pow(10, i); } return new Histogram(rangeValues); }
public float apply (float a) { if (a == 0) return 0; a = 1 - a; return (1 - (float)Math.pow(value, power * (a - 1)) * MathUtils.sin(a * bounces) * scale); } }
/** * Returns the probability that {@linkplain #mightContain(Object)} will erroneously return {@code * true} for an object that has not actually been put in the {@code BloomFilter}. * * <p>Ideally, this number should be close to the {@code fpp} parameter passed in {@linkplain * #create(Funnel, int, double)}, or smaller. If it is significantly higher, it is usually the * case that too many elements (more than expected) have been put in the {@code BloomFilter}, * degenerating it. * * @since 14.0 (since 11.0 as expectedFalsePositiveProbability()) */ public double expectedFpp() { // You down with FPP? (Yeah you know me!) Who's down with FPP? (Every last homie!) return Math.pow((double) bits.bitCount() / bitSize(), numHashFunctions); }
@Test public void SPR9486_floatPowerFloat() { Number expectedResult = Math.pow(10.21f, -10.2f); ExpressionParser parser = new SpelExpressionParser(); StandardEvaluationContext context = new StandardEvaluationContext(); Expression expression = parser.parseExpression("10.21f ^ -10.2f"); Number result = expression.getValue(context, null, Number.class); assertEquals(expectedResult, result); }
@Test public void SPR9486_floatPowerDouble() { Number expectedResult = Math.pow(10.21f, 10.2); ExpressionParser parser = new SpelExpressionParser(); StandardEvaluationContext context = new StandardEvaluationContext(); Expression expression = parser.parseExpression("10.21f ^ 10.2"); Number result = expression.getValue(context, null, Number.class); assertEquals(expectedResult, result); }