Class StiFunctionsMath
java.lang.Object
com.stimulsoft.report.dictionary.functions.StiFunctionsMath
Copyright Stimulsoft
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleclamp(double value, double min, double max) Clamps a double-precision floating-point value to a specified range.static longclamp(long value, long min, long max) Clamps a long value to a specified range.static BigDecimalclamp(BigDecimal value, BigDecimal min, BigDecimal max) Clamps a BigDecimal value to a specified range.static doublefrac(double value) Returns the fractional part of the specified double-precision floating-point number.static BigDecimalfrac(BigDecimal value) Returns the fractional part of the specified decimal number.
-
Constructor Details
-
StiFunctionsMath
public StiFunctionsMath()
-
-
Method Details
-
frac
Returns the fractional part of the specified decimal number.- Parameters:
value- A decimal number.- Returns:
- The fractional part of the specified decimal number.
-
frac
public static double frac(double value) Returns the fractional part of the specified double-precision floating-point number.- Parameters:
value- A double-precision floating-point number.- Returns:
- The fractional part of the specified double-precision floating-point number.
-
clamp
public static double clamp(double value, double min, double max) Clamps a double-precision floating-point value to a specified range.- Parameters:
value- The value to clamp.min- The minimum value of the range.max- The maximum value of the range.- Returns:
- The clamped value.
-
clamp
Clamps a BigDecimal value to a specified range.- Parameters:
value- The value to clamp.min- The minimum value of the range.max- The maximum value of the range.- Returns:
- The clamped value.
- Throws:
IllegalArgumentException- if any argument is null.
-
clamp
public static long clamp(long value, long min, long max) Clamps a long value to a specified range.- Parameters:
value- The value to clamp.min- The minimum value of the range.max- The maximum value of the range.- Returns:
- The clamped value.
-