<< Prev        Next >>

ID : 782

Fix

Function

To return integer part of the numerical value.

Syntax

Fix(number)

Guaranteed entry

number
Designate double precision real number type data.

Return value

Return integer type data.

Description

Return integer part of the numerical value.
This is "Round toward zero(RZ)" function which rounds down the absolute value with ignoring signs.
When designating negative value as variable, return the smallest negative integer which is larger than variable.

Fix(1.5) is "1".
Fix(-1.5) is "-1".

Related Terms

Arithmetic Function, Int

 

Attention

 

Example

'!TITLE "Acquiring the integer part of the specified numerical value"

Sub Main
	
    ' Executing the following line will store 3 into I[0].
    ' (Numerical value is rounded to the units.)
    I[0]=2.6

    ' Executing the following line will store 2 into I[1].
    ' (Numerical value is rounded down to the nearest whole number.)
    I[1]=Fix(2.6)

End Sub

ID : 782

<< Prev        Next >>