X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=doc%2Fbin_dec_hex.1;h=2a8c49b3ad2296b4d8e4896bc96faa536d65337b;hb=d9822df7ed5e8122cf3a62e4e99678e94007f504;hp=77441886b737bec21f792f629213dce61f409026;hpb=ecfac614b914cef110a81ac665997a9b186da500;p=pkg-rrdtool.git diff --git a/doc/bin_dec_hex.1 b/doc/bin_dec_hex.1 index 7744188..2a8c49b 100644 --- a/doc/bin_dec_hex.1 +++ b/doc/bin_dec_hex.1 @@ -1,15 +1,7 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp @@ -48,22 +40,25 @@ . ds R" '' 'br\} .\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" .\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.if \nF \{\ +.ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.if n .na +.el \{\ +. de IX +.. +.\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -129,7 +124,11 @@ .\" ======================================================================== .\" .IX Title "BIN_DEC_HEX 1" -.TH BIN_DEC_HEX 1 "2007-11-20" "1.2.26" "rrdtool" +.TH BIN_DEC_HEX 1 "2013-05-23" "1.4.8" "rrdtool" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh .SH "NAME" bin_dec_hex \- How to use binary, decimal, and hexadecimal notation. .SH "DESCRIPTION" @@ -142,7 +141,7 @@ it is not the first one. .PP If this sounds cryptic to you, this is what I've just said in numbers: .PP -.Vb 14 +.Vb 10 \& 0 \& 1 \& 2 @@ -179,7 +178,7 @@ digits. They only use two different symbols, namely \*(L"0\*(R" and \*(L"1\*(R". the same rules to this set of digits and you get the binary numbering system: .PP -.Vb 14 +.Vb 10 \& 0 \& 1 \& 10 @@ -246,9 +245,7 @@ representations, but with eight different symbols. \& Octal (8) \& Decimal (10) \& Hexadecimal (16) -.Ve -.PP -.Vb 23 +\& \& (2) (8) (10) (16) \& 00000 0 0 0 \& 00001 1 1 1 @@ -300,7 +297,8 @@ you're writing in. Some of the prefixes are \*(L"0x\*(R" for C, \*(L"$\*(R" for Pascal, \*(L"#\*(R" for \s-1HTML\s0. It is common to assume that if a number starts with a zero, it is octal. It does not matter what is used as long as you know what it is. I will use \*(L"0x\*(R" for hexadecimal, \*(L"%\*(R" for binary -and \*(L"0\*(R" for octal. The following numbers are all the same, just their represenatation (base) is different: 021 0x11 17 \f(CW%00010001\fR +and \*(L"0\*(R" for octal. The following numbers are all the same, just their +representation (base) is different: 021 0x11 17 \f(CW%00010001\fR .PP To do arithmetics and conversions you need to understand one more thing. It is something you already know but perhaps you do not \*(L"see\*(R" it yet: @@ -356,7 +354,7 @@ It is the same in all other representations: This example can not be done for binary as that system only uses two symbols. Another example: .PP -%1010 would be +\&\f(CW%1010\fR would be .PP .Vb 4 \& 1 * 2^3 @@ -408,12 +406,12 @@ is therefore \*(L"0\*(R" and we now have 0xA0??. (which is just plain 16) four times and write down \*(L"4\*(R" to get 0xA04?. Subtract 64 from 69 (69 \- 4*16) and the last digit is 5 \-\-> 0xA045. .PP -The other method builds ub the number from the right. Let's try 41'029 +The other method builds up the number from the right. Let's try 41'029 again. Divide by 16 and do not use fractions (only whole numbers). .PP .Vb 4 -\& 41'029 / 16 is 2'564 with a remainder of 5. Write down 5. -\& 2'564 / 16 is 160 with a remainder of 4. Write the 4 before the 5. +\& 41\*(Aq029 / 16 is 2\*(Aq564 with a remainder of 5. Write down 5. +\& 2\*(Aq564 / 16 is 160 with a remainder of 4. Write the 4 before the 5. \& 160 / 16 is 10 with no remainder. Prepend 45 with 0. \& 10 / 16 is below one. End here and prepend 0xA. End up with 0xA045. .Ve @@ -431,7 +429,7 @@ has the advantage that you can see very easily if you should write down a zero or a one: if you divide by two the remainder will be zero if it is an even number and one if it is an odd number: .PP -.Vb 16 +.Vb 10 \& 41029 / 2 = 20514 remainder 1 \& 20514 / 2 = 10257 remainder 0 \& 10257 / 2 = 5128 remainder 1 @@ -474,9 +472,7 @@ Group \f(CW%1010000001000101\fR by three and convert into octal: \& %1 010 000 001 000 101 \& %001 010 000 001 000 101 \& 1 2 0 1 0 5 \-\-> 0120105 -.Ve -.PP -.Vb 3 +\& \& So: %1010000001000101 = 0120105 = 0xA045 = 41029 \& Or: 1010000001000101(2) = 120105(8) = A045(16) = 41029(10) \& Or: 1010000001000101(2) = 120105(8) = A045(16) = 41029 @@ -532,4 +528,4 @@ other people by pointing them to this document when they are asking basic questions. They will not only get their answer, but at the same time learn a whole lot more. .PP -Alex van den Bogaerdt +Alex van den Bogaerdt