References
- “Numerical Analysis”, Timothy Sauer
Polynomials
What is the best way to evaluate say, at x = 1/2? Try to minimize the number of additions and multiplications.\
Method 1: This method requires 10 multiplications and 4 additions
Binary Numbers
Binary numbers are expressed as
where each binary digit, or bit, is 0 or 1. The base 10 equivalent to the number is
For example the decimal number 4 is expressed as in base 2, and 3/4 is represented as .
Decimal to Binary
To convert to binary it is simplest to break the number into integer and fractional parts and convert each part separately. For the number we convert each part to binary and combine.
Integer part Convert decimal integers to binary by dividing by 2 successively and recording the remainders. The remainders, 0 or 1, are recorded by starting at the decimal point (or more accurately, \textbf{radix}) and moving away (to the left). For we would have
Therefore, the base 10 number 53 can be written in bits as , denoted .
Fractional part Convert to binary by reversing the preceding steps. Multiply by 2 successively and record the integer parts, moving away from the decimal point to the right.
Notice that the process repeats after four steps and will repeat indefinitely exactly the same way. Therefore,
Putting the two parts together we get