Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.util.MathUtils Class Reference

Utility class for mathematical functions. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.util.MathUtils:

Static Public Member Functions

static int div (final int numerator, final int denominator)
 Calculates (. More...
 
static int divRound (final int numerator, final int denominator)
 Returns the quotient of two values, rounded to the nearest integer. More...
 
static int divRoundUp (final int numerator, final int denominator)
 Returns the quotient of two values, rounded up to the nearest integer. More...
 
static int mod (final int numerator, final int denominator)
 Calculates the remainder of. More...
 

Private Member Functions

 MathUtils ()
 Private constructor to prevent instantiation. More...
 

Detailed Description

Utility class for mathematical functions.

Author
Andreas Kirschbaum

Definition at line 28 of file MathUtils.java.

Constructor & Destructor Documentation

◆ MathUtils()

com.realtime.crossfire.jxclient.util.MathUtils.MathUtils ( )
private

Private constructor to prevent instantiation.

Definition at line 33 of file MathUtils.java.

Member Function Documentation

◆ div()

static int com.realtime.crossfire.jxclient.util.MathUtils.div ( final int  numerator,
final int  denominator 
)
static

Calculates (.

a/b

).

Parameters
numeratorthe numerator
denominatorthe denominator
Returns
the quotient

Definition at line 42 of file MathUtils.java.

◆ divRound()

static int com.realtime.crossfire.jxclient.util.MathUtils.divRound ( final int  numerator,
final int  denominator 
)
static

Returns the quotient of two values, rounded to the nearest integer.

Parameters
numeratorthe numerator
denominatorthe denominator
Returns
the quotient

Definition at line 79 of file MathUtils.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.ItemPainter.paint().

+ Here is the caller graph for this function:

◆ divRoundUp()

static int com.realtime.crossfire.jxclient.util.MathUtils.divRoundUp ( final int  numerator,
final int  denominator 
)
static

Returns the quotient of two values, rounded up to the nearest integer.

Parameters
numeratorthe numerator
denominatorthe denominator
Returns
the quotient

Definition at line 66 of file MathUtils.java.

Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredMapHeight(), com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredMapWidth(), and com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.setMapSize().

+ Here is the caller graph for this function:

◆ mod()

static int com.realtime.crossfire.jxclient.util.MathUtils.mod ( final int  numerator,
final int  denominator 
)
static

Calculates the remainder of.

a/b

.

Parameters
numeratorthe numerator
denominatorthe denominator
Returns
the quotient

Definition at line 55 of file MathUtils.java.

Referenced by com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.setMapSize().

+ Here is the caller graph for this function:

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