Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why is-1 divided by 2 equal to 0 in C language?
Why is-1 divided by 2 equal to 0 in C language?
C language is a strongly typed language.

JAVA is not, so data processing is different.

You must divide two integer data.

Int type is integer data, and only integers can be saved.

If you divide two floating-point or double-precision data, the situation is different.

Will be equal to 0.5.

============================

The problem of complement, that is the compiler's business, don't worry about it.

The reason why high-level languages are invented is to liberate programmers from tedious assembly code.

That's the compiler's business.