Home>Article> What does int mean in vb

What does int mean in vb

藏色散人
藏色散人 Original
2020-12-03 09:48:58 26041browse

Int in vb refers to the function that takes an integer. Its syntax is such as "int(x)", which means taking the largest integer not greater than x; functions similar to the int function include the Fix function, which will Removes the decimal part and returns the remaining integer.

What does int mean in vb

The operating environment of this article: Windows 7 system, Dell G3 computer, Visual Basic version 6.0.

The int function in VB language means taking an integer.

That is: the int(x) function takes the largest integer not greater than x.

For example:

1, baiint(4.88)=4

int(4.88) is to take an integer that is not greater than 4.88 and is closest to 4.88, so int(4.88 )=4.

2. int(8.1)=8

int(8.1) is an integer that is no greater than 8.1 and closest to 8, so int(8.1)=8.

3. int(-5.6)=-6

nt(-5.6) is an integer that is no greater than -5.6 and closest to -5.6, so int(-5.6)= -6.

Extended information:

Functions similar to the int function

Fix function: The Fix function will delete the decimal part of the number and return the remaining integer.

The difference between the Fix function and the int function:

1. Fix(99.2) = 99;

int(99.8) =99.

Fix function directly deletes the decimal part 0.2 and takes 99; the int function takes an integer not greater than 99.8, so 99 is taken.

2. Fix(-99.8) = -99;

int(-99.8)= -100.

The Fix function directly deletes the decimal part 0.8 and takes -99; the int function takes an integer not greater than -99.8, so it takes -100.

3. Fix(-99.2) = -99;

Int(-99.2) = -100.

The Fix function directly deletes the decimal part 0.2 and takes -99; the int function takes an integer not greater than -99.2, so it takes -100.

Recommended: "Programming Video"

The above is the detailed content of What does int mean in vb. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn