Most of the numerical data processed by computers contain decimals. There are usually two ways to represent the decimal point in computers. One is to agree that the decimal point of all numerical data is implicit in a certain At a fixed position, it is called fixed-point representation, or fixed-point number for short; the other is that the decimal point position can float, which is called floating-point representation, or floating-point number for short.
Fixed-point representation (fixed-point) The so-called fixed-point format means that the decimal point position of all data in the machine is agreed to be fixed. (Recommended learning: web front-end video tutorial)
There are usually two simple conventions used in computers: fix the position of the decimal point before the highest digit of the data, or fix after the lowest bit.
The former is generally called a fixed-point decimal, and the latter is a fixed-point integer.
Fixed-point decimals are pure decimals, and the agreed decimal point position is after the sign bit and before the highest digit of the significant value part. If the data x is in the form of x = x0.
Floating-point number representation (floating-point number) is similar to scientific notation. Any J-base number N can always be written as N = J E × M where M is called the mantissa of the number N (mantissa), is a pure decimal; E is the exponent of the number N, which is an integer, and J is called the base of the scaling factor J E.
This representation method is equivalent to the decimal point position of the number being able to float freely within a certain range depending on the scale factor, so it is called floating point representation. The base number is agreed in advance (usually 2) and does not appear in the computer.
When expressing a floating-point number in the machine, first, the mantissa must be given and expressed in fixed-point decimal form.
The mantissa part gives the number of significant digits, thus determining the representation accuracy of floating point numbers.
The second is to give the exponent code, expressed in integer form. The exponent code indicates the position of the decimal point in the data, thus determining the representation range of floating point numbers. Floating point numbers also need a sign bit.
The above is the detailed content of What are the two representations of numerical data in computers?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment
