Single-precision floating-point numbers and significant digits why are 7-bit

Source: Internet
Author: User

The IEEE754 standard describes in detail the format of single-precision floating-point numbers Chaviki Wikipedia ieee_754-1985 describes the categories that include how to express (Statute non-regulated 0 infinite NAN) and why it is so expressed

The more the number of digits, the higher the precision, and the more the digits, the larger the range is. This concept is described in physics with useful numbers . https://zh.wikipedia.org/wiki/%E6%9C%89%E6%95%88%E6%95%B0%E5%AD%97

The number of valid digits for single-precision floating-point numbers is 7 bits, and the answers are as follows:

The precision of a floating-point number depends on the part of the tail. The more digits in the number of tails, the more valid numbers can be represented. The mantissa of the single-precision number is stored with 23 bits, plus the default 1-bit 1,2^ (23+1) = 16777216 before the decimal point. Because 10^7 < 16777216 < 10^8, the effective number of single-precision floating-point numbers is 7 bits.


However, it is still not clear why the number of effective digits is 7 bits.

A number if the number of significant digits is greater than 7 bits such as 1.27893456076(12-bit), with float to indicate that can not be accurately stored.

Run:

float a = 1.23456789076f;//--->a = 1.2345679

That is, the format of 1.23456789076 stored in a float in a computer can only be approximated to the seventh bit,

It also depends on whether the number (decimal number) can be accurately represented by a finite number of bits. float = 2.202 float = 2.25

Single-precision floating-point numbers and significant digits why are 7-bit

Related Article

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.