How many bytes are gigabytes (GB)?

When I convert between 1 GB to bytes using online tools, I get different answers. For example, using Google Convertor:, 1GB=1e+9and in another converter I get 1GB= 1073741824. I believe that the device is used differently based on 1KB=1024Bor 1KB=1000B(this is a Google unit).

How do I know which device my machine uses using a small program or feature? Does C have a macro for this? I want to do this, since my program will probably be launched through various operating systems.

+8
source share
3 answers

Two tools convert two different devices. 1 GB = 10^9bytes, and 1 GiB = 2^30bytes.

Google GiB GB, .

.

Factor  Name    Symbol  Origin  Derivation   Decimal
 2^10   kibi    Ki  kilobinary: (2^10)^1    kilo: (10^3)^1
 2^20   mebi    Mi  megabinary: (2^10)^2    mega: (10^3)^2
 2^30   gibi    Gi  gigabinary: (2^10)^3    giga: (10^3)^3
 2^40   tebi    Ti  terabinary: (2^10)^4    tera: (10^3)^4
 2^50   pebi    Pi  petabinary: (2^10)^5    peta: (10^3)^5
 2^60   exbi    Ei  exabinary:  (2^10)^6    exa:  (10^3)^6

, (SI). . , , SI bi.

- GB GiB, GB , GiB . : , 1 MB 1 048 576 bytes i.e. 1MiB. () 1 MB 1 000 000 . , 6.4 GB (6 400 000 000 bytes), 6.1 GB 6 400 000 000/1 048 576 000= ~ 6.1 GiB

.

+13

. G 10⁹ Gi 2³⁰. , GiB.

+3
  • "" - .
  • gibi 2 ^ 30, 1073741824 = 1024 .

  • GiB. , () 1998 .

  • "" (), 10 ^ 9 = 1000000000 , 1 ≈ 1,024 . 1024 .

  • In the context of computer memory, gigabytes and gigabytes are usually used to refer to 1024 ^ 3 (2 ^ 30) bytes, although not in the context of data transfer and not necessarily for the size of the hard disk.

enter image description here

0
source

All Articles