INT()

INT()

Top  Previous  Next

 

The INT() function returns the integer part of a value.

 

 

Format

 

INT(expr)

 

where

 

exprevaluates to a number or a numeric array.

 

 

The INT() function returns the integer part of expr. Any fractional part after rounding in accordance with the INTPREC configuration parameter is discarded such that INT(1.9), for example, evaluates to 1.

 

If expr is a numeric array (a dynamic array where all elements are numeric), the INT() function operates on each element in turn and returns a numeric array with the same structure as expr.

 

 

Example

 

N = INT(A / B)

 

This statement finds the integer part of the quotient of A / B and assigns this to N. The IDIV() function provides an alternative way to achieve this but is specific to QMBasic.

 

 
See also:

BOOL(), NUMERIC(), STR()