Floating Point Number

Source: Internet
Author: User

1.1.1 accuracy and error

For any number to represent the system, we assume a general equation rep (a). This function returns the value nearest to A. The ideal system is of course for all input, rep (A) =. however, in a computer, it indicates a very short range, and we cannot completely represent all real numbers in all ranges. The rep equation is a multi-to-one ing. An infinite number of real numbers a are mapped to a definite return value. For a definite return value, an infinite number of input is not equal to the output, that is, almost all real numbers, Rep ()! = A. This table is

An Approximate Representation.

Using (REP (a)-A), we can deduce the values of several metric errors. Absolute error is the simplest representation method. It is defined as | rep (a)-A |, which only represents the distance between the value and the actual value on the number axis. However, the absolute error does not correctly reflect the difference between the actual value and the actual value. There is no another important factor for the quantitative error-the ratio of the error to the calculation result.

Suppose we have a measurement system, the Unit is accurate to kilometers. This unit can be considered precise in measuring the distance from the Earth to the Sun (149597871 km. However, if this unit is used to measure the size of an Apple (0.00011 km), it is very inaccurate because it may be rounded to 0 km. In both cases, the absolute error is less than 1 km, but it is obvious that the absolute error is not suitable for all cases.

The relative error is expressed by dividing the absolute error by the actual value: | (REP (a)-A)/A |, so the relative error is non-dimensional. Due to division, the relative error cannot be calculated as a value close to 0.

1.2 floating point number

1.2.1 scientific notation

To better introduce floating-point numbers, let's first review the well-known real-number representation standard in science and engineering: Scientific notation. The computer floating point notation is similar to this. The right part of the scientific notation is composed:

  1. A score, also called mantissa, is between 1.0 and 10.0.
  2. An integer, also called an exponent ).

These two parts are combined into a number of mantissax10exponet.

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.