Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - I wrote a program with KEIL to display decimals with a digital tube. I choose * * * 8 P0 ports and P 1 port to receive data. Here are the functions, and the results show all the functions.
I wrote a program with KEIL to display decimals with a digital tube. I choose * * * 8 P0 ports and P 1 port to receive data. Here are the functions, and the results show all the functions.
Single-chip microcomputer is a practical computer, there is no need to use floating-point numbers.

Decimals are all calculated in whole numbers.

Generally, byte type, large number and integer type are used, so there are 5 decimal places.

Actual data shows that four significant figures can usually be used.

Calculate complex intermediate variables and use long integers to ensure accuracy.

Only when displaying, according to the need, in a certain position, display the decimal point.