Miscellaneous Integer Functions


Ceiling Function: Ceiling(x, y) = Ceiling(x/y) = least integer >= rational fraction x/y
See: Ceiling Function -- From MathWorld
and Wolfram Function Evaluation

Floor Function: Floor(x, y) = Floor(x/y) = greatest integer <= rational fraction x/y
See: Floor Function -- From MathWorld
and Wolfram Function Evaluation

Sign: Sign(x) = 0 if x = 0, Sign(x) = 1 if x > 0, else Sign(x) = −1.
It is 0 or the unit vector in the same direction as x.

Round: Round(x, y) = Round(x/y) = Integer nearest to rational fraction x/y,
Round(13/2) = 7, Round(−13/2) = −7.
See: Nearest Integer Function -- From MathWorld
and Wolfram Function Evaluation

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

NotEqual: (x != y) = (x <> y) = 0 (False) if x − y is 0, else (x != y) = 1 (True).

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

Greater: (x > y) = 1 (True) if y − x is negative, 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 == y, Max(x, y) = x,
Else if x > y, 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 == y, Min(x, y) = x,
Else if x > y, Min(x, y) = y,
Else Min(x, y) = x.
See: Minimum -- From MathWorld
and Wolfram Function Definition

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

Remainder or Congruence Function: Mod(x, y) = x − y * Floor(x/y),
but y != 0. 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

Power Functions, x^y: Pow(x, y),
If x = 1, 1^y = 1,
Else if y = 0, x^0 = 1 (including 0^0 = 1),
Else if x = 0 and y > 0, 0^pos = 0,
Else if x = 0 and y < 0, 0^neg = error,
Else if y > 0, x^y = x*x*x*...*x, y times,
Else if x = −1, (−1)^y = (−1)^|y|, (+1 if |y| is even, −1 if |y| is odd)
Else if |x| > 1 and y < 0, x^y = 0,
See: Power -- From MathWorld
and Wolfram Function Evaluation

Square: Sq(x) = x^2 = x*x.
See: Square -- From MathWorld
and Wolfram Function Evaluation

Square Root, The positive Square Root and remainder function: SqRt(x),
error if x < 0. The remainder, Re = x − Sq(SqRt(x)) >= 0, is also computed,
0 <= Re <= 2*SqRt(x). For example SqRt(24) = 4, Re = 8.
See: Square Root -- From MathWorld
and Wolfram Function Evaluation

Cube Root, The Cube Root and remainder function: CuRt(x),
The remainder, Re = x − y^3 >= 0 where y = CuRt(x), is also computed.
The sign of y and x are the same and 0 <= Re <= 3*y*(y+1). For example,
CuRt(26) = 2, Re = 18, CuRt(−26) = −3, Re = 1, CuRt(−28) = −4. Re = 36.
See: Cube Root -- From MathWorld
and Wolfram Function Evaluation

Magnitude and remainder Function: Mag(x, y) = SqRt(Sq(x), Sq(y)),
and Re = Remainder or the integer SqRt function.
See: Polar Coordinates -- From MathWorld

Factorial Function: Fac(x) = x! = 1*2*3*...*x,
0! = 1, x! not defined for x < 0.
See: Factorial -- From MathWorld
and Wolfram Function Evaluation

Absolute value: Abs(x) = |x|, If x >= 0, |x| = x Else |x| = −x.

Negative: −x = 0 − x.

Return to Number Theory, Algorithms, and Real Functions
Return to Harry's Home Page


This page accessed times since Feb 17, 2006.
Page created by: hjsmithh@sbcglobal.net
Changes last made on Monday, 06-Aug-07 20:47:26 PDT