Class Math

java.lang.Object
ise.antelope.tasks.Math

public class Math extends Object
Provides access to java.lang.Math and java.lang.StrictMath for Ant. Provides add, subtract, multiply, divide and mod methods as well as access to all methods java.lang.Math and java.lang.StrictMath via reflection.

Copyright 2003, Dale Anson, all rights reserved

  • Field Details

    • BIGDECIMAL_TYPE

      public static Class BIGDECIMAL_TYPE
    • BIGINT_TYPE

      public static Class BIGINT_TYPE
  • Constructor Details

    • Math

      public Math()
    • Math

      public Math(boolean strict)
  • Method Details

    • setStrict

      public void setStrict(boolean strict)
    • isStrict

      public boolean isStrict()
    • add

      public static BigDecimal add(BigDecimal a, BigDecimal b)
    • add

      public static BigInteger add(BigInteger a, BigInteger b)
    • and

      public static BigInteger and(BigInteger a, BigInteger b)
    • and

      public static int and(int a, int b)
    • or

      public static BigInteger or(BigInteger a, BigInteger b)
    • or

      public static int or(int a, int b)
    • not

      public static BigInteger not(BigInteger a)
    • not

      public static int not(int a)
    • xor

      public static BigInteger xor(BigInteger a, BigInteger b)
    • xor

      public static int xor(int a, int b)
    • add

      public static double add(double a, double b)
    • add

      public static float add(float a, float b)
    • add

      public static long add(long a, long b)
    • add

      public static int add(int a, int b)
    • add

      public static BigInteger add(BigInteger[] a)
    • add

      public static double add(double[] a)
    • add

      public static float add(float[] a)
    • add

      public static long add(long[] a)
    • add

      public static int add(int[] a)
    • subtract

      public static BigDecimal subtract(BigDecimal a, BigDecimal b)
    • subtract

      public static BigInteger subtract(BigInteger a, BigInteger b)
    • subtract

      public static double subtract(double a, double b)
    • subtract

      public static float subtract(float a, float b)
    • subtract

      public static long subtract(long a, long b)
    • subtract

      public static int subtract(int a, int b)
    • subtract

      public static BigDecimal subtract(BigDecimal[] a)
    • subtract

      public static BigInteger subtract(BigInteger[] a)
    • subtract

      public static double subtract(double[] a)
    • subtract

      public static float subtract(float[] a)
    • subtract

      public static long subtract(long[] a)
    • subtract

      public static int subtract(int[] a)
    • multiply

      public static BigDecimal multiply(BigDecimal a, BigDecimal b)
    • multiply

      public static BigInteger multiply(BigInteger a, BigInteger b)
    • multiply

      public static double multiply(double a, double b)
    • multiply

      public static float multiply(float a, float b)
    • multiply

      public static long multiply(long a, long b)
    • multiply

      public static int multiply(int a, int b)
    • multiply

      public static BigDecimal multiply(BigDecimal[] a)
    • multiply

      public static BigInteger multiply(BigInteger[] a)
    • multiply

      public static double multiply(double[] a)
    • multiply

      public static float multiply(float[] a)
    • multiply

      public static long multiply(long[] a)
    • multiply

      public static int multiply(int[] a)
    • divide

      public static BigDecimal divide(BigDecimal a, BigDecimal b)
    • divide

      public static BigInteger divide(BigInteger a, BigInteger b)
    • divide

      public static double divide(double a, double b)
    • divide

      public static float divide(float a, float b)
    • divide

      public static long divide(long a, long b)
    • divide

      public static int divide(int a, int b)
    • divide

      public static BigDecimal divide(BigDecimal[] a)
    • divide

      public static BigInteger divide(BigInteger[] a)
    • divide

      public static double divide(double[] a)
    • divide

      public static float divide(float[] a)
    • divide

      public static long divide(long[] a)
    • divide

      public static int divide(int[] a)
    • mod

      public static BigInteger mod(BigInteger a, BigInteger b)
    • mod

      public static double mod(double a, double b)
    • mod

      public static float mod(float a, float b)
    • mod

      public static long mod(long a, long b)
    • mod

      public static int mod(int a, int b)
    • mod

      public static BigInteger mod(BigInteger[] a)
    • mod

      public static double mod(double[] a)
    • mod

      public static float mod(float[] a)
    • mod

      public static long mod(long[] a)
    • mod

      public static int mod(int[] a)
    • greaterThan

      public static boolean greaterThan(int x, int y)
    • greaterThan

      public static boolean greaterThan(long x, long y)
    • greaterThan

      public static boolean greaterThan(double x, double y)
    • greaterThan

      public static boolean greaterThan(BigInteger x, BigInteger y)
    • greaterThan

      public static boolean greaterThan(BigDecimal x, BigDecimal y)
    • lessThan

      public static boolean lessThan(int x, int y)
    • lessThan

      public static boolean lessThan(long x, long y)
    • lessThan

      public static boolean lessThan(double x, double y)
    • lessThan

      public static boolean lessThan(BigInteger x, BigInteger y)
    • lessThan

      public static boolean lessThan(BigDecimal x, BigDecimal y)
    • equal

      public static boolean equal(int x, int y)
    • equal

      public static boolean equal(long x, long y)
    • equal

      public static boolean equal(double x, double y)
    • equal

      public static boolean equal(BigInteger x, BigInteger y)
    • equal

      public static boolean equal(BigDecimal x, BigDecimal y)
    • notEqual

      public static boolean notEqual(int x, int y)
    • notEqual

      public static boolean notEqual(long x, long y)
    • notEqual

      public static boolean notEqual(double x, double y)
    • notEqual

      public static boolean notEqual(BigInteger x, BigInteger y)
    • notEqual

      public static boolean notEqual(BigDecimal x, BigDecimal y)
    • factorial

      public static BigInteger factorial(BigInteger x)
    • factorial

      public static int factorial(double x)
    • factorial

      public static int factorial(float x)
    • factorial

      public static int factorial(int x)
    • min

      public static BigDecimal min(BigDecimal a, BigDecimal b)
    • min

      public static BigInteger min(BigInteger a, BigInteger b)
    • max

      public static BigDecimal max(BigDecimal a, BigDecimal b)
    • max

      public static BigInteger max(BigInteger a, BigInteger b)
    • pow

      public static BigInteger pow(BigInteger y, BigInteger x)
      y raised to the x power
    • pow

      public static BigDecimal pow(BigDecimal y, BigDecimal x)
      y raised to the x power
    • calculate

      public Number calculate(String op, String[] operands)
      Do a mathematical calculation. The allowed operations are all operations supported by java.lang.Math and this class. Assumes data type is "double".
      Parameters:
      op - the name of a mathematical operation to perform
      operands - the operands for the operation, these strings must parse to numbers.
    • calculate

      public Number calculate(String op, String type, String[] operands)
      Do a mathematical calculation. The allowed operations are all operations supported by java.lang.Math.
      Parameters:
      op - the name of a mathematical operation to perform
      type - the data type of the operands
      operands - the operands for the operation
      Returns:
      the result of the calculation. For boolean operations, returns 1 for true, 0 for false;