Fix
FIX(number)
Description
FIX removes the fractional part from a number, returning the integer closest to 0. The required parameter, number, is any numeric expression. When number is positive, the next smallest integer is returned; when number is negative, the next largest integer is returned. The required parameter, number, is any valid numeric expression.
Example
REM FIX Example 'FIX converts floats to int nearest 0 DIM Pos, Neg Pos = EXP(1) Neg = -EXP(1) PRINT "FIX(e) = " & FIX(Pos) PRINT "FIX(-e) = " & FIX(Neg)
Output
FIX(e) = 2 FIX(-e) = -2
Related Items