Home > Common Problem > body text

What does int mean in vb

藏色散人
Release: 2023-02-09 13:50:56
Original
26196 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template