#Bin Fractions
8 messages in this thread
I'm having a major bad hair day trying to understand binary fractional
numbers… Anyone have words of enlightnment? Thanks.
Jay,
Not much to say about them what sort of difficulty you having?
I converting some code to run on the amiga and I was having major
problems understanding how it worked. The author of the original
code clued me in and told me afterward. Don't sweat not getting
fractions with binary numbers. If I don't work with them for a while
I tend to get confused also. So label me confused <grin>
Binary fractions? Same method, generally, as when you're doing it in decimal.
That is, keep on with the calculation and don&t stop at the decimal point.
Keep in mind that 1/10 is a repeating fraction in binary, so you may need to
pay careful attention to rounding
If you're comfortable with multi-word arithmetic, binary fractions are just
more of the same. But it still may take some time to get used to the idea that
hexadecimal 0.36DB6DB6DB… is 1/5!
–Jim
Jim,
a nice description. BTW, welcome back! Nice to see an competant hand
around.
Brian
bjbart@watserv.ucr.edu
Thanks, Brian. It's surprising how many mathematical operations are "just like
in decimal" .. once you are used to multi-word math.
Trouble is, 16-bit (and subsequent 32-bit) math often means that
the programmer can do it all in one instruction, and tends to forget
all that multiple-word linkage using the C or X flags or whatever.
Gosh, when we had to do it 8 bits at a time (remember?) we HAD to do
that kind of thing all the time.
Jim,
boy do I remember! In a sense, I think the era of the "neat hack"
ended when we stopped having to learn those flags, and the shortcuts they
allowed.
Brian
bjbart@watserv.ucr.edu
Yes thats the problem <grin> thanks for the letter tho. I'm muddling
thru it….