BrightSide Workbench Full Report + Source Code
org.turro.math.NumberUtils Class Reference

Static Public Member Functions

static double round (Number value, int digits)
 
static double percent (Number value, int digits)
 
static boolean isEven (Number value)
 
static boolean isOdd (Number value)
 
static boolean isZero (Number value, int precision)
 
static boolean isInteger (Number value)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 26 of file NumberUtils.java.

Member Function Documentation

◆ isEven()

static boolean org.turro.math.NumberUtils.isEven ( Number  value)
static

Definition at line 36 of file NumberUtils.java.

36  {
37  return value.longValue() % 2 == 0;
38  }
Here is the caller graph for this function:

◆ isInteger()

static boolean org.turro.math.NumberUtils.isInteger ( Number  value)
static

Definition at line 48 of file NumberUtils.java.

48  {
49  return !Double.isInfinite(value.doubleValue()) && (value.doubleValue() == Math.floor(value.doubleValue()));
50  }

◆ isOdd()

static boolean org.turro.math.NumberUtils.isOdd ( Number  value)
static

Definition at line 40 of file NumberUtils.java.

40  {
41  return !isEven(value);
42  }
static boolean isEven(Number value)
Here is the call graph for this function:

◆ isZero()

static boolean org.turro.math.NumberUtils.isZero ( Number  value,
int  precision 
)
static

Definition at line 44 of file NumberUtils.java.

44  {
45  return Zero.near(value, precision);
46  }
Here is the call graph for this function:

◆ percent()

static double org.turro.math.NumberUtils.percent ( Number  value,
int  digits 
)
static

Definition at line 32 of file NumberUtils.java.

32  {
33  return new Round(value.doubleValue()).perCent(digits);
34  }
Here is the call graph for this function:

◆ round()

static double org.turro.math.NumberUtils.round ( Number  value,
int  digits 
)
static

Definition at line 28 of file NumberUtils.java.

28  {
29  return new Round(value.doubleValue()).decimals(digits).value();
30  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: