Floating point (IEEE-754)

Source: Internet
Author: User

Floating-point numbers are also called "real numbers", and a floating-point number consists of three parts

  1. Sign Bit (S)
  2. Order Code
  3. Valid numbers

S: Order Code: Valid numbers

Floating-point numbers are represented by the science two-level system.

Three types of floating-point numbers:

  1. Short floating point (32bit): S (BIT31): Order Code (BIT30~BIT23): Valid number (BIT22~BIT0)
  2. Long floating point (64bit): S (BIT63): Order Code (BIT62~BIT52): Valid number (BIT51~BIT0)
  3. Temporary character point (80bit): S (bit79): Order Code (BIT78~BIT64): Valid number (BIT63~BIT0)

Floating-point conversion

1. Convert 10 binary to binary number

2. Normalize the binary number

3. Calculate the Order Code

4. Store this number in floating-point format

For example: floating point 100.2510, to a single-precision floating point number

1.100.25 = 1100100.01

2.1100100.01 = 1.10010001 x 2^6

3.110 + 0111111 = 10000101

4. Sign bit = 0

Order Code = 10000101

Valid number = 1001 0001 0000 0000 0000 000

Floating point (IEEE-754)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.