Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Is there any difference between the definition of significant figures in C language and the definition in mathematics?
Is there any difference between the definition of significant figures in C language and the definition in mathematics?

What do you mean by significant figures?

If it is the value of data, whether it is a variable or a constant,

its value is a fixed number,

This is the same as in mathematics ,

However, the quantities (variables or constants) used to store them are based on hardware (memory),

And the memory sticks commonly used at this stage, in the process of programming, < /p>

It can be abstracted as a linear array,

and the size is limited,

and the value range of the quantity is determined.

So except for the size limit,

there is almost no other difference from the definition in mathematics.

If you have to add one more difference,

< p>That is, numbers in mathematics can be added all the time,

We know that we can add to infinity,

But the quantities in computers can only represent the range of a number,

< p>So it cannot reach infinity,

This is the so-called overflow.

Compared with integers, real numbers (decimals) are more meaningful.

C language uses floating point numbers (floating point numbers and fixed point numbers are commonly used in computer systems to represent real numbers) to represent real numbers.

The storage and shaping of real numbers in computers are somewhat different.

The storage of integer data is the sequential combination of its binary data.

The storage of real numbers is represented by "scientific notation".

Using order The representation of codes, tail codes, etc. is slightly more complicated than floating point numbers.

In actual applications,

integers will be "truncated", also called "truncation" or "overflow",

This is the internal processing of integer data happened when.

Real numbers sometimes experience "truncation",

which is "rounding",

refers to what happens when real numbers are converted between different data types. "Loss of accuracy"

If you are satisfied, please accept it; if you are not satisfied, please ask again