Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is a constant?
What is a constant?
What are the following constants:

The first point: integer constant

Integer constants are data of integer type, which have four representations: binary, octal, decimal and hexadecimal.

The second point: floating-point constant

Floating-point number constants are decimals used in mathematics, which are divided into foat single-precision floating-point numbers and double-precision floating-point numbers. Among them, single-precision floating-point numbers end with f or f, and double-precision floating-point numbers end with d or d. Of course, floating-point numbers can end without any suffix, in which case the virtual opportunity defaults to double-precision floating-point numbers. Floating-point constants can also be expressed in exponential form.

The third point: character constants

Character constants are used to represent a character. A character constant is caused by a pair of single quotation marks in English half-width format, which can be special characters represented by English letters, numbers, punctuation marks and escape sequences.

The fourth point: string constants

String constants are used to represent continuous strings, and string constants should be enclosed in a pair of double quotation marks in English half-width format.

Fifth point: Boolean constant

Boolean constants are two Boolean values, true and false. This constant is used to distinguish between the true and false of a thing.

Point 6: null constant

The null constant has only one value null, which means that the reference of the object is empty.

The broad concept of "invariability" is "invariable quantity". In other words, although constant serves the hardware, software and programming languages in computer technology, it is not a concept specially introduced for hardware, software and programming languages.

Constants can be divided into different types, such as: 25 and 0 are integer constants, 6.8 is a real constant, and' a' and' b' are character constants. Constants can usually be judged from their literal forms. This constant is called literal constant or direct constant.

The popular metaphor of "unchanged" is "like a mountain that is not easy to change". (Of course, when the seas run dry and the rocks crumble, the acceleration of gravity on the earth will change; The constant used by people is a quantity that will not change for a long time. The speed of light in vacuum is theoretically constant.