All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pnuts.lang.Arithmetic

pnuts.lang.Arithmetic

public final class Arithmetic
The Arithmetic class is geared for transparent multi-precision arithmetic operations.

Here is the type conversion table for binary operation:

BigDecimalBigIntegerDoubleFloatLongInteger
BigDecimalBigDecimalBigDecimalBigDecimalBigDecimalBigDecimalBigDecimal
BigIntegerBigDecimalBigIntegerBigDecimalBigDecimalBigIntegerBigInteger
DoubleBigDecimalBigDecimalDoubleDoubleDoubleDouble
FloatBigDecimalBigDecimalDoubleFloatFloatFloat
LongBigDecimalBigIntegerDoubleFloatLongLong
IntegerBigDecimalBigIntegerDoubleFloatLongInteger


Variable Index

 o EQUAL
 o LEFT_IS_BIGGER
 o NOT_EQUAL
 o RIGHT_IS_BIGGER

Constructor Index

 o Arithmetic()

Method Index

 o abs(Object)
 o add(Object, Object)
 o and(Object, Object)
 o compareTo(Object, Object)
 o divide(Object, Object)
 o gcd(Object, Object)
 o inverse(Object)
 o mod(Object, Object)
 o multiply(Object, Object)
 o negate(Object)
 o not(Object)
 o or(Object, Object)
 o pow(Object, Object)
 o remainder(Object, Object)
 o shiftArithmetic(Object, Object)
 o shiftLeft(Object, Object)
 o shiftRight(Object, Object)
 o subtract(Object, Object)
 o xor(Object, Object)

Variables

 o NOT_EQUAL
 public static final int NOT_EQUAL
 o LEFT_IS_BIGGER
 public static final int LEFT_IS_BIGGER
 o RIGHT_IS_BIGGER
 public static final int RIGHT_IS_BIGGER
 o EQUAL
 public static final int EQUAL

Constructors

 o Arithmetic
 public Arithmetic()

Methods

 o add
 public static final Object add(Object n1,
                                Object n2)
 o subtract
 public static final Object subtract(Object n1,
                                     Object n2)
 o multiply
 public static final Object multiply(Object n1,
                                     Object n2)
 o divide
 public static final Object divide(Object n1,
                                   Object n2)
 o compareTo
 public static final int compareTo(Object n1,
                                   Object n2)
 o remainder
 public static final Object remainder(Object n1,
                                      Object n2)
 o gcd
 public static final Object gcd(Object n1,
                                Object n2)
 o pow
 public static final Object pow(Object n1,
                                Object n2)
 o mod
 public static final Object mod(Object n1,
                                Object n2)
 o and
 public static final Object and(Object n1,
                                Object n2)
 o or
 public static final Object or(Object n1,
                               Object n2)
 o xor
 public static final Object xor(Object n1,
                                Object n2)
 o shiftLeft
 public static final Object shiftLeft(Object n1,
                                      Object n2)
 o shiftRight
 public static final Object shiftRight(Object n1,
                                       Object n2)
 o shiftArithmetic
 public static final Object shiftArithmetic(Object n1,
                                            Object n2)
 o abs
 public static final Object abs(Object n1)
 o negate
 public static Object negate(Object n1)
 o inverse
 public static Object inverse(Object n1)
 o not
 public static final Object not(Object n1)

All Packages  Class Hierarchy  This Package  Previous  Next  Index