Fortune Telling Collection - Zodiac Analysis - What does %g mean in C language?

What does %g mean in C language?

%g is an output format type of printf () function in C language, which means that single-precision and double-precision real numbers are output with short output width in %f%e, and %e format is used when the exponent is less than -4 or greater than or equal to precision.

Extended data

C language is a general computer programming language, which is widely used in the bottom development. The design goal of C language is to provide a programming language that can compile and process low-level memory in a simple way, generate a small amount of machine code and run without any support of running environment.

Although C language provides many low-level processing functions, it still maintains good cross-platform characteristics. C language programs written in standard specifications can be compiled on many computer platforms, even including some embedded processors (single chip microcomputer or MCU) and supercomputers.

References:

Baidu encyclopedia -C language