public class FloatUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int[] |
POW10 |
| Constructor and Description |
|---|
FloatUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
almostEqual(float a,
float b,
float absoluteDiff,
float relativeDiff)
Method checks if two float numbers are similar.
|
static void |
computeAutoGeneratedAxisValues(float start,
float stop,
int steps,
AxisAutoValues outValues)
Computes the set of axis labels to show given start and stop boundaries and an ideal number of stops between
these boundaries.
|
static int |
formatFloat(char[] formattedValue,
float value,
int endIndex,
int digits,
char separator)
Formats a float value to the given number of decimals.
|
static double |
nextDown(double d)
Returns next smaller float value considering precision of the argument.
|
static float |
nextDownF(float f)
Returns next smaller float value considering precision of the argument.
|
static double |
nextUp(double d)
Returns next bigger double value considering precision of the argument.
|
static float |
nextUpF(float f)
Returns next bigger float value considering precision of the argument.
|
static float |
roundToOneSignificantFigure(double num)
Rounds the given number to the given number of significant digits.
|
public static float nextUpF(float f)
public static float nextDownF(float f)
public static double nextUp(double d)
public static double nextDown(double d)
public static boolean almostEqual(float a,
float b,
float absoluteDiff,
float relativeDiff)
public static float roundToOneSignificantFigure(double num)
public static int formatFloat(char[] formattedValue,
float value,
int endIndex,
int digits,
char separator)
public static void computeAutoGeneratedAxisValues(float start,
float stop,
int steps,
AxisAutoValues outValues)
start - The minimum extreme (e.g. the left edge) for the axis.stop - The maximum extreme (e.g. the right edge) for the axis.steps - The ideal number of stops to create. This should be based on available screen space; the more
space
there is, the more stops should be shown.outValues - The destination AxisAutoValues object to populate.