Utils.fractionCompare

Compares the fractions a_n/a_d and b_n/b_d and returns -1 if a < b, 0 if a = b and 1 if a > b.

struct Utils
static
int
fractionCompare
(
int aN
,
int aD
,
int bN
,
int bD
)

Parameters

aN int

Numerator of first value

aD int

Denominator of first value

bN int

Numerator of second value

bD int

Denominator of second value

Return Value

Type: int

-1 if a < b; 0 if a = b; 1 if a > b.