Double type data storage

Source: Internet
Author: User

Double Type 64 bits (0~63)

Where the highest bit 63bit represents the symbol: 0 positive 1 negative

Exponent bit of 62~52bit:11 bit

52~0bit:52 bits of data bits

Example Description:-64.446263

    1. Total 8 bytes, 63bit:1;
    2. 62~52bit:64=100 000; So the exponent should be 7, where the hidden bit technique is used, the first bit 1 is hidden, so the digit = 6, and the digit base is 1023 so the end is 1029=100 0000 0101;
    3. 52~0: The first 6 bits should be 00 0000 (64=100 0000 hidden highest bit 1); the remaining 46 bits represent 0.446263

Use hexadecimal notation: 0x c0 00 50 ...

The actual store is a high-order byte on the far right.

Char type to double type you can use the memcpy function in C + +:

    Char temp[8,-3,-------------113,--  (--  );     Double d=0;    memcpy (8);

Double type data storage

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.