# Miscellaneous Complex Computations

Ceiling Function: Ceiling(x) = {Ceiling(x.r), Ceiling(x.i)}
where Ceiling(x.r) = least integer >= x.r
and Ceiling(x.i) = least integer >= x.i.
See: Ceiling Function -- From MathWorld
and Wolfram Function Evaluation

Floor Function: Floor(x) = {Floor(x.r), Floor(x.i)}
where Floor(x.r) = greatest integer <= x.r
and Floor(x.i) = greatest integer <= x.i.
See: Floor Function -- From MathWorld
and Wolfram Function Evaluation

Integer Part: Int(x) = {Int(x.r), Int(x.i)}
where Int(x.r) = Sign(x.r)*Floor(|x.r|)
and Int(x.i) = Sign(x.i)*Floor(|x.i|).
See: Integer Part -- From MathWorld
and Wolfram Function Evaluation

Fractional Part: Frac(x) = {Frac(x.r), Frac(x.i)}
where Frac(x.r) = Sign(x.r)*(|x.r| − Floor(|x.r|))
and Frac(x.i) = Sign(x.i)*(|x.i| − Floor(|x.i|)).
See: Fractional Part -- From MathWorld
and Wolfram Function Evaluation

Round: Round(x) = {Round(x.r), Round(x.i)}
where Round(x.r) = Integer nearest to x.r
and Round(x.i) = Integer nearest to x.i.
See: Nearest Integer Function -- From MathWorld
and Wolfram Function Evaluation

Equal: (x == y) = 1 (True) if x.r == y.r and x.i == y.i, else (x == y) = 0 (False).
See: Equal -- From MathWorld
and Wolfram Mathematica Documentation

NotEqual: (x != y) = (x <> y) = 1 (True) if x.r != y.r or x.i != y.i, else (x != y) = 0 (False).

These following functions are normally only defined for real numbers:

Less: (x < y) = 1 (True) if (x.r < y.r) or ((x.r == y.r) and (x.i < y.i)), else (x < y) = 0 (False).
See: Less -- From MathWorld
and Wolfram Mathematica Documentation

Greater: (x > y) = 1 (True) if (x.r > y.r) or ((x.r == y.r) and (x.i > y.i)), else (x > y) = 0 (False).

LessEqual: (x <= y) = 1 (True) if (x < y) or (x == y), else (x <= y) = 0 (False).

GreaterEqual: (x >= y) = 1 (True) if (x > y) or (x == y), else (x >= y) = 0 (False).

Maximum: Max(x, y) = x or y
if x.r == y.r and x.i == y.i, Max(x, y) = x
else if x.r > y.r, Max(x, y) = x
else if x.r < y.r, Max(x, y) = y
else if x.i > y.i, Max(x, y) = x
else Max(x, y) = y.
See: Maximum -- From MathWorld
and Wolfram Function Definition

Minimum: Min(x, y) = x or y
if x.r == y.r and x.i == y.i, Max(x, y) = x
else if x.r > y.r, Max(x, y) = y
else if x.r < y.r, Max(x, y) = x
else if x.i > y.i, Max(x, y) = y
else Max(x, y) = x.
See: Minimum -- From MathWorld
and Wolfram Function Definition

Quotient Function: Quotient(x, y) = Floor(x/y),
but y != 0.
See: Congruence -- From MathWorld
and Wolfram Function Definition

Remainder or Congruence Function: Mod(x, y) = x − y * Floor(x/y),
but y != 0. For real x, y, the sign of Mod(x, y) is the same as y.
This is the remainder of Quotient(x, y). y*Quotient(x, y) + Mod(x, y) = x.
See: Congruence -- From MathWorld
and Wolfram Function Definition

Magnitude Function: Mag(x, y) = SqRt(x.r^2 + x.i^2 + y.r^2 + y.i^2)
When x and y are real, Mag(x, y) is Polar coordinates radius coordinate
of the Cartesian coordinates (x, y).
See: Polar Coordinates -- From MathWorld
and Wolfram Function Definition