If (x> 0.000001 & X

Source: Internet
Author: User
Tags float number

Float accuracy in C
Float storage format:
S E M
One-digit symbol-bit 8-digit index 23-digit ending number

Convert to a value that is: V = (-1) ^ s * 1.m * 2 ^ (E-127)

If 16.5 is converted to binary 00010000.1 => 1.00001*2 ^ 4,
The memory representation is:
Symbol bit index 4 + 127 = 131 tails
0 10000011 00001 000000000000000000

In the conversion process, it is obvious that the higher the integer part of the float number, the lower the precision of the decimal part.
For the float number, the valid number is about 7 digits (2 ^ 23 is about equal to 10 ^ 7). Therefore, the more digits the integer part occupies
The lower the precision, when the integer part exceeds 9999999, the decimal part is completely inaccurate.

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.