Fix

From NSB App Studio
Revision as of 12:13, 5 July 2012 by Brendon (talk | contribs) (Created page with "FIX(''number'') '''Description''' FIX removes the fractional part from a number, returning the integer closest to 0. The required parameter, ''number'', is any numeric expre...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

INT