Int

Description:              Integer Portion of Number. This function returns the portion of a number before the decimal point.

Returns:                    Integer

Usage:                       Script or Steady State.

Format:                      Int(X)

Parameters:             X     { numeric }  { required }  { no default }

                                                Any numeric expression. Normally this is a floating point value.

Comments:               The Int function is sometimes referred to as "floor."

Examples:

a = Int(1.00);

b = Int(1.12);

c = Int(1.99);

d = Int(2.00);

e = Int(-1.00);

f = Int(-1.9);

 The variables a, b, c, d, e and f will have values of 1, 1, 1, 2, -1 and -2 respectively.

x1 = 3.4;

y1 = 4.7;

x2 = Int(x1 + 0.5);

y2 = Int(y1 + 0.5);

The value of x2 and y2 in the above example will be 3 and 5 respectively. Notice how adding 0.5 to each value causes the Int function to perform mathematical rounding rather than truncation.

See Also:

Ceil | Step | Math Functions