@Test public void testShouldPow() throws Exception { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { assertEquals((int) Math.pow(i, j), Maths.pow(i, j)); } } }
static int pow(int value, int exponent) { if(exponent == 0) { return 1; } if(exponent == 1) { return value; } if (exponent % 2 == 0) { return pow(value * value, exponent / 2); } else { return value * pow(value * value, (exponent - 1) / 2); } }
Maths { static int pow(int value, int exponent) { if(exponent == 0) { return 1; } if(exponent == 1) { return value; } if (exponent % 2 == 0) { return pow(value * value, exponent / 2); } else { return value * pow(value * value, (exponent - 1) / 2); } } }
Maths { static int pow(int value, int exponent) { if(exponent == 0) { return 1; } if(exponent == 1) { return value; } if (exponent % 2 == 0) { return pow(value * value, exponent / 2); } else { return value * pow(value * value, (exponent - 1) / 2); } }  }
Maths { static int pow(int value, int exponent) { if(exponent == 0) { return 1; } if(exponent == 1) { return value; } if (exponent % 2 == 0) { return pow(value * value, exponent / 2); } else { return value * pow(value * value, (exponent - 1) / 2); } }  static double getRoundedAmount(double nominal, double value); static double sumUp(Double l, int sign, Double r); static double sumUp(Double l, Double r); static double subtract(Double l, Double r); static boolean equals(double d1, double d2, int precision); static boolean less(double d1, double d2, int precision); static boolean more(double d1, double d2, int precision); @Nullable static T min(T... numbers); @Nullable static T min(Collection<T> numbers); static double getNotNull(@Nullable Double value); @Nullable static T max(T... numbers); @Nullable static T max(Collection<T> numbers); @Nullable static T minMax(@Nullable Collection<T> numbers, @Nonnull ComparisonType comparisonType); @Nonnull static T minMax(@Nonnull T first, @Nonnull T second, @Nonnull ComparisonType comparisonType); static double round(@Nonnull Double value, int precision); static float getDistance(@Nonnull Point2d startPoint,
									@Nonnull Point2d endPoint); static Point2d subtract(@Nonnull Point2d p1, @Nonnull Point2d p2); static Point2d sum(@Nonnull Point2d p1, @Nonnull Point2d p2); static float getNorm(@Nonnull Point2d point); static float getAngle(@Nonnull Point2d startPoint,
								 @Nonnull Point2d axisEndPoint,
								 @Nonnull Point2d endPoint,
								 @Nullable MutableObject<Boolean> left); static double countMean(@Nonnull List<Double> objects); static double countStandardDeviation(@Nonnull Double mean, @Nonnull List<Double> objects); static StatData getStatData(@Nonnull List<Double> objects); }
Maths { static int pow(int value, int exponent) { if(exponent == 0) { return 1; } if(exponent == 1) { return value; } if (exponent % 2 == 0) { return pow(value * value, exponent / 2); } else { return value * pow(value * value, (exponent - 1) / 2); } }  static double getRoundedAmount(double nominal, double value); static double sumUp(Double l, int sign, Double r); static double sumUp(Double l, Double r); static double subtract(Double l, Double r); static boolean equals(double d1, double d2, int precision); static boolean less(double d1, double d2, int precision); static boolean more(double d1, double d2, int precision); @Nullable static T min(T... numbers); @Nullable static T min(Collection<T> numbers); static double getNotNull(@Nullable Double value); @Nullable static T max(T... numbers); @Nullable static T max(Collection<T> numbers); @Nullable static T minMax(@Nullable Collection<T> numbers, @Nonnull ComparisonType comparisonType); @Nonnull static T minMax(@Nonnull T first, @Nonnull T second, @Nonnull ComparisonType comparisonType); static double round(@Nonnull Double value, int precision); static float getDistance(@Nonnull Point2d startPoint,
									@Nonnull Point2d endPoint); static Point2d subtract(@Nonnull Point2d p1, @Nonnull Point2d p2); static Point2d sum(@Nonnull Point2d p1, @Nonnull Point2d p2); static float getNorm(@Nonnull Point2d point); static float getAngle(@Nonnull Point2d startPoint,
								 @Nonnull Point2d axisEndPoint,
								 @Nonnull Point2d endPoint,
								 @Nullable MutableObject<Boolean> left); static double countMean(@Nonnull List<Double> objects); static double countStandardDeviation(@Nonnull Double mean, @Nonnull List<Double> objects); static StatData getStatData(@Nonnull List<Double> objects); static final float MIN_AMOUNT; }