Community QBasic

Rebooting the QBasic we all know and love!


Project maintained by Cory Smith

FIX

Returns the integer portion of a floating-point expression.

Syntax

FIX(numeric_expression)

Comments

numeric_expression is any numeric expression.

FIX does not round off numbers, it simply eliminates the decimal point and all characters to the right of the decimal point.

FIX(x) is equivalent to SGN(x)*INT(ABS(x)). The major difference between FIX and INT is that FIX does not return the next lower number for negative x.

FIX is useful in modulus arithmetic.

Examples

PRINT FIX(58.75)
58
PRINT FIX(-58.75)
-58

See Also