Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Vb is long, why is the result 0?
Vb is long, why is the result 0?
First of all, you have to figure out what is an integer, or a number without a decimal. This is the knowledge of primary school mathematics. So when assigning a number with a decimal to a long variable, VB will automatically convert this number into an integer.

Dim a, b and c are the same length.

be qualified for sth

Dim a is variant, b is variant and c is long.

So a and b can contain decimals, but c can't.

therefore

c=a-b

=-0.569832-(-0.63295)

=0.63295-0.569832

=0.063 1 18

=0 (rounded)

So c=0