On Mon, 7 Apr 2008 11:08:23 -0500, "tlmfru" <lacey@[EMAIL PROTECTED]
> wrote:
>Robert <no@[EMAIL PROTECTED]
> wrote in message
>news:521gv394rgj59j3d8u86clvp0a8am6857n@[EMAIL PROTECTED]
>> On Sat, 5 Apr 2008 10:54:00 -0600, "tlmfru" <lacey@[EMAIL PROTECTED]
> wrote:
>>
>> >
>> >One very good reason that pure binary representation was not used is
that
>> >decimal fractions cannot (generally) be expressed except as a
repeating
>> >number in binary. Examples: 0.2 (decimal) = .00110011 ... (binary).
.12
>> >(decimal) = .000111 etc. (binary).
>>
>> To pay for something costing .50, you don't tear a dollar bill in half
(a
>fraction), you
>> tender 50 pennies (an integer).
>>
>
>Nevertheless, if you're calculating what happened, you've spent half a
>dollar - unless you convert ALL the figures to pennies.
No conversion is necessary. Figures are already in pennies.
>> >To make correct arithmetic using only binary possible, it seems to me
>that
>> >ALL numbers must be implicitly scaled to remove the decimal point. If
>that
>> >is your meaning, Robert, then you haven't made it clear. Binary
>fractions
>> >cannot be represented accurately - period.
>>
>> I did make it clear. Here's the thread:
>>
>> >> On Mon, 31 Mar 2008 21:55:10 -0300, Clark F Morris
>> >> <cfmpublic@[EMAIL PROTECTED]
> wrote:
>> >>
>> >>>Try doing a simple divide like calculate the value of 1 / 5 in
binary.
>> >>
>> >> OK.
>> >>
>> >> 01 numerator value 1 binary pic 9(9).
>> >> 01 denominator value 5 binary pic 9(9).
>> >> 01 quotient binary pic 9(9)v9(4).
>> >>
>> >> compute quotient = numerator / denominator
>> >> display quotient
>> >>
>> >> 0000000002000
>> >>
>> >>>You get a never ending fraction.
>> >>
>> >> Looks pretty diadic to me.
>> >
>> >That's because you did not do it in binary, you did it in decimal.
>> >One-fifth is rational in decimal, but irrational in binary.
>>
>> >Nope, all three numbers are binary INTEGERS. The fallacy is in
thinking
>of quotient as a fraction. It is not a fraction, it is an integer.
>> > The compiler SCALED two integers by multiplying by powers of 10, then
>divided two binary integers to get a quotient with no fraction.
>> > Binary 10 divided by binary 5 gives binary 2.
>>
>> >101111101011110000100000000 / 1100001101010000 = 11111010000
>
>This isn't the point. The point is that with very few exceptions a
decimal
>number with figures on both sides of the decimal point can't be
represented
>as a pure binary number, as the fractional ****tion is almost always
>non-terminating. Binary ONE divided by binary 5 gives binary
.00110011.....
>A scaled number is not the number itself: it's a transformation of the
>original.
By definition, integers are whole numbers. There is no fractional part to
an integer.
>Incidentally, how do you decode that string of digits?
I paste it into a calculator and hit Dec. Hardware does it by doubling
the answer and
adding each bit, left to right.
>> >Incidentally - everybody knows about the simple algoritm to convert
base
>10
>> >numbers to base 2 - i.e. repeated division by 2 -
>> >I had some fun working out the mirror algorithm to convert decimal
>FRACTIONS
>> >to binary fractions. (Very easy, actually). (Both algorithms work
for
>any
>> >base). But what puzzles me is I've never seen this written up
anywhere.
>> >I'm certain that the early developers of computers (or perhaps IBM
>research
>> >fellows) must have discovered the algorithm. Has anyone seen it
written
>up?
It's of no use when dealing with integers, because they have no fractional
part.
>Very interesting! But doesn't answer my question. I'd really like to
make
>an original contribution to math or computer science but I can't believe
>that "my algorithm" is it.
Now you're in the domain of abstraction and generalization, a faux pas in
these parts.


|