Package org.apfloat
Class RoundingHelper
- java.lang.Object
-
- org.apfloat.RoundingHelper
-
class RoundingHelper extends java.lang.ObjectHelper class for rounding functions.- Since:
- 1.7.0
- Version:
- 1.11.0
-
-
Constructor Summary
Constructors Modifier Constructor Description privateRoundingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompareToHalf(Apfloat x)static intcompareToHalf(Aprational x)private static booleanisEven(Apint x)static ApintroundToInteger(Apfloat x, java.math.RoundingMode roundingMode)static ApfloatroundToMultiple(Apfloat x, Apfloat y, java.math.RoundingMode roundingMode)static AprationalroundToMultiple(Aprational x, Aprational y, java.math.RoundingMode roundingMode)static ApfloatroundToPlaces(Apfloat x, long places, java.math.RoundingMode roundingMode)static ApfloatroundToPrecision(Apfloat x, long precision, java.math.RoundingMode roundingMode)
-
-
-
Method Detail
-
roundToMultiple
public static Apfloat roundToMultiple(Apfloat x, Apfloat y, java.math.RoundingMode roundingMode) throws java.lang.IllegalArgumentException, java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.IllegalArgumentExceptionjava.lang.ArithmeticExceptionApfloatRuntimeException
-
roundToMultiple
public static Aprational roundToMultiple(Aprational x, Aprational y, java.math.RoundingMode roundingMode) throws java.lang.IllegalArgumentException, java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.IllegalArgumentExceptionjava.lang.ArithmeticExceptionApfloatRuntimeException
-
roundToPlaces
public static Apfloat roundToPlaces(Apfloat x, long places, java.math.RoundingMode roundingMode) throws java.lang.IllegalArgumentException, java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.IllegalArgumentExceptionjava.lang.ArithmeticExceptionApfloatRuntimeException
-
roundToPrecision
public static Apfloat roundToPrecision(Apfloat x, long precision, java.math.RoundingMode roundingMode) throws java.lang.IllegalArgumentException, java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.IllegalArgumentExceptionjava.lang.ArithmeticExceptionApfloatRuntimeException
-
roundToInteger
public static Apint roundToInteger(Apfloat x, java.math.RoundingMode roundingMode) throws java.lang.IllegalArgumentException, java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.IllegalArgumentExceptionjava.lang.ArithmeticExceptionApfloatRuntimeException
-
compareToHalf
public static int compareToHalf(Apfloat x)
-
compareToHalf
public static int compareToHalf(Aprational x)
-
isEven
private static boolean isEven(Apint x)
-
-