Top Description Constructors Methods
com.sun.javafx.scene.layout

public Class ScaledMath

extends Object
Class Inheritance

Math functions which deal with rounding scaled values.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static double

Returns:

value ceiled with scale
ceil
(double
The value that needs to be ceiled
value
,
double
The scale that will be used
scale
)

The value is ceiled with a given scale using Math.ceil.

public static double

Returns:

value floored with scale
floor
(double
The value that needs to be floored
value
,
double
The scale that will be used
scale
)

The value is floored for a given scale using Math.floor.

public static double

Returns:

value rounded with scale
rint
(double
The value that needs to be rounded
value
,
double
The scale that will be used
scale
)

The value is rounded with a given scale using Math#rint(double).

public static double

Returns:

value rounded with scale
round
(double
The value that needs to be rounded
value
,
double
The scale that will be used
scale
)
Deprecated uses Math#round(double) instead of Math#rint(double), don't use in new code, use rint(double, double)

The value is rounded with a given scale using Math#round(double).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ScaledMathback to summary
public ScaledMath()

Method Detail

ceilback to summary
public static double ceil(double value, double scale)

The value is ceiled with a given scale using Math.ceil. When the absolute value of the given value multiplied by the current scale is less than 10^15, then this method guarantees that:

scaledCeil(scaledCeil(value, scale), scale) == scaledCeil(value, scale)
The limit is about 10^15 because double values will no longer be able to represent larger integers with exact precision beyond this limit.
Parameters
value:double

The value that needs to be ceiled

scale:double

The scale that will be used

Returns:double

value ceiled with scale

floorback to summary
public static double floor(double value, double scale)

The value is floored for a given scale using Math.floor. When the absolute value of the given value multiplied by the current scale is less than 10^15, then this method guarantees that:

scaledFloor(scaledFloor(value, scale), scale) == scaledFloor(value, scale)
The limit is about 10^15 because double values will no longer be able to represent larger integers with exact precision beyond this limit.
Parameters
value:double

The value that needs to be floored

scale:double

The scale that will be used

Returns:double

value floored with scale

rintback to summary
public static double rint(double value, double scale)

The value is rounded with a given scale using Math#rint(double).

Parameters
value:double

The value that needs to be rounded

scale:double

The scale that will be used

Returns:double

value rounded with scale

roundback to summary
public static double round(double value, double scale)

Deprecated

uses Math#round(double) instead of Math#rint(double), don't use in new code, use rint(double, double)

The value is rounded with a given scale using Math#round(double).

Parameters
value:double

The value that needs to be rounded

scale:double

The scale that will be used

Returns:double

value rounded with scale

Annotations
@Deprecated