Use the FileSize () function command to implement statistics for file size, requiring: 1, one output in GB, MB, KB, B, 2. The order of magnitude must be greater than 1 less than 1024 and retain two decimal places;
Commencement of construction:
Copy Code code as follows:
$len = FileSize ("1.RMVB");
$i = 4;
while ($i) {
if ($out = $len/pow (1024, $i) >1.0| | $i ==1) {
Switch ($i) {
C
1bit=1 bit 2 binary information 1B (byte byte)1KB (kilobyte KB) =2 (Ten) b=1024b=2 (ten) B;1MB (Megabyte MBytes) =2 (Ten) kb=1024kb=2 B; equivalent to the content of a short story.1GB (Gigabyte gigabytes) =2 (mb=1024mb=2) B; the equivalent of a short story.1TB (Trillionbyte) =2 (gb=1024gb=2) B; equivalent to the music content of Beethoven's fifth movement Symphon
The fastest way to calculate the file size, output amp; apos; B amp; apos;, amp; apos; KB amp; apos ;, amp; apos; MB amp;
So far, it may be the fastest calculation method.Is it faster?
Date_default_timezone_set ('utc ');
Function format_bytes ($ size)
{
$ Arr = array ('B', 'KB', '
The smallest basic unit is byte should not have many people do not know, the following first in order to give all units
Byte, KB, MB, GB, TB, PB, EB, ZB, YB, DB, NB
I only know the top five, and most people know it, according to the rate of 1024 calculation
1tb=2 's 40-Time Square byte=1099511627776 Byte
1pb=2 's 50-time Square Byte=1125899906842624byte
1eb=2 60-Time Square byte= 1152921504606846976 Byte
1z
Recently solved a problem-reducing memory usage. However, this method can only be used in WINXP and Win2k, without displaying that the main form is always running.ProgramBest. In the past, the program used 11 MB of memory. I used the dynamic window creation method to reduce the size by less than 100 kb. After applying this method, the memory usage was only 496 kb
equals 8 bits (1byte=8bit). Eight-bit binary number minimum is 00000000, the maximum is 11111111; usually 1 bytes can be stored in an ASCII code, 2 bytes can hold a Chinese character GB code.3, the wordWhen a computer is processing data, the length of time it accesses, processes, and transmits is called word. A word is usually made up of one or more bytes (usually the integer bits of bytes). For example, the word 286 microcomputer consists of 2 bytes, its word length is 16;486 microcomputer's w
BYTE (byte) is B: A byte is made up of 8-bit binary digits (1 byte = 8 bit). Byte is the most common base unit in the information store.
An English letter (case-insensitive) occupies a byte of space, a Chinese character occupies two bytes of space.Symbol: English punctuation 2 is a byte, Chinese punctuation is two bytes.
A binary numeric sequence, as a digital unit in a computer, typically a 8-bit binary number,If an ASCII code is a byte, the conversion of such units is:
1000 gigabyte (tb,kil
56 kbps/8 = 7 kbps, that is, 7 kb of Data downloaded per second.
In the operating system, the disk capacity is 1024 in hexadecimal format between GB, MB, and kb. Hard Disk manufacturers usually calculate the disk capacity based on 1 GB = 1000 MB and 1 MB =
is capital B). For example, we use thunder to download a plug-in, in the speed column, we often see kb/s. What is the problem? That is because we usually use bytes to indicate the file size, because if the bit is used to indicate the file size, the number is too large and hard to remember, so it is expressed in bytes. The size of the file transmitted over the network in one second is 1
can not use the general MB and Mbit conversion relationship (1b=8bit) to convert. For example, the official internal data transmission rate of a product is 683mbit/s, at this time can not simply think that 683 divided by 8 to get 85.375, it is considered that 85mb/s is the internal data transmission rate of the hard disk. Because in the 683Mbit also contains a lot of bit (bit) of auxiliary information, not exactly the hard disk transmission data, sim
What is the maximum size of the Sqlite database? Will dozens of MB be cracked like the acc database? On Baidu encyclopedia, some people say it can be several GB, some people say it can be several hundred MB, some people say it's okay to say it's okay if it's a few TB, and the hard disk is big enough. How big is it? (Without detailed performance impact)...
During multipart Upload, we set chunk_size to 4 MB. sometimes the chunk_size will not be moved when the chunk_size is uploaded to 8 MB. what is the multipart Upload process for Qiniu, here, we set chunk_size to 4 MB for uploading. sometimes the chunk_size will not stop when it is uploaded to 8
Problem:
1. A computer is 32 characters long and its storage capacity is 16 Mb.Double-CharacterAddressing, what is its addressing range?
2. A host has 32 characters and the storage capacity is 64 MB.BytesAddressing. What is its addressing range?
Answer:
My method is to convert all the elements into one-bit binary units for calculation. Calculate the total capacity first. For example, in the first questi
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.