@OpenApiAll
public class MathTool
extends com.nomagic.magicreport.engine.Tool
Constructor and Description |
---|
MathTool() |
Modifier and Type | Method and Description |
---|---|
static double |
abs(double a)
Returns the absolute value of an
double value. |
static int |
abs(int a)
Returns the absolute value of an
int value. |
static double |
ceil(double a)
Returns the smallest (closest to negative infinity)
double value that is greater than or equal
to the argument and is equal to a mathematical integer. |
static double |
floor(double a)
Returns the largest (closest to positive infinity)
double value that is less than or equal to
the argument and is equal to a mathematical integer. |
static double |
max(double a,
double b)
Returns the greater of two
double values. |
static int |
max(int a,
int b)
Returns the greater of two
int values. |
static double |
min(double a,
double b)
Returns the smaller of two
double values. |
static int |
min(int a,
int b)
Returns the smaller of two
int values. |
static long |
round(double a)
Returns the closest
long to the argument. |
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setProperties
public static int abs(int a)
int
value. If the argument is not negative, the argument is
returned. If the argument is negative, the negation of the argument is returned.a
- the argument whose absolute value is to be determinedpublic static double abs(double a)
double
value. If the argument is not negative, the argument is
returned. If the argument is negative, the negation of the argument is returned.a
- the argument whose absolute value is to be determinedpublic static double ceil(double a)
double
value that is greater than or equal
to the argument and is equal to a mathematical integer. Special cases:
a
- a value.public static double floor(double a)
double
value that is less than or equal to
the argument and is equal to a mathematical integer. Special cases:
a
- a value.public static int max(int a, int b)
int
values. If the arguments have the same value, the result is that
same value.a
- an argument.b
- another argument.a
and b
.public static double max(double a, double b)
double
values. If the arguments have the same value, the result is
that same value.a
- an argument.b
- another argument.a
and b
.public static int min(int a, int b)
int
values. If the arguments have the same value, the result is that
same value.a
- an argument.b
- another argument.a
and b
.public static double min(double a, double b)
double
values. If the arguments have the same value, the result is
that same value.a
- an argument.b
- another argument.a
and b
.public static long round(double a)
long
to the argument. The result is rounded to an integer by adding 1/2,
taking the floor of the result, and casting the result to type long
.a
- a floating-point value to be rounded to a long
.long
value.Copyright © 2015 - No Magic Asia