Fix (function)

<< Click to Display Table of Contents >>

Fix (function)

Fix(Num)

Returns the integral part of a numerical expression.

The difference to the Int function is in the handling of negative numbers: while Int always returns the next integer less than or equal to Num, the function Fix simply removes the part after the decimal separator (see example).

See also: Int

Example:

Sub Main

 Print Int( 1.4)   ' -> 1

 Print Fix( 1.4)   ' -> 1

 Print Int(-1.4)   ' -> -2

 Print Fix(-1.4)   ' -> -1

End Sub