Floating-point operations in VDSP (bf561) (4): Flt_max

Source: Internet
Author: User

A flt_max is a constant defined in float.h to represent the maximum value of a single-precision floating-point number.

#define FLT_MAX 3.4028234663852886e+38f

So where does this value come from?

From the representation of floating point can know, to take the maximum, you can set the index and the mantissa are the maximum value, because the Standard rules will be 1 to leave the index is a special expression, so the maximum index is 255, this number is

0 11111110 11111111111111111111111

Sign bit exponent mantissa

The value of the 16-based integer to see it is the 0x7f 7f FF ff.

According to the calculation formula of floating-point number, the value is:

1.9999997615814208984375 * 2 (254-127)

= 3.4028234663852886E+38

This is the calculation result of the calculator.

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.