binary arithmetic habits

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

binary arithmetic habits

Post by VolTeK »

I dont know if im the only one, but at the moment im trying to get into the habbit of dividing binary, in a more binary way.


For some reason, i convert it to decimal in my head, and do the math in decimal, then convert the result to binary.

I know this is cheating, but does anyone else do this?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: binary arithmetic habits

Post by Combuster »

For manual calculations, it's always long division whenever the arguments happen not to be part of your brain's lookup table. It works the same for decimal, binary, octal, and whatever number range you want to perform - it just becomes simpler for smaller digits and is really straightforward in the binary case. It also works for decimal numbers if you know the caveats.

Plus, if you have one of those unlucky RISC architectures where there's no native multiply or divide, long division is exactly the algorithm you will be using to compute the answer.

If you lack pen and paper, converting to decimal and back does seem to be much more memory efficient and less error-prone for most people, as the brain can only have so many symbols live. dealing with 5-digit decimals easily beats dealing with the relatively huge 16 digit binary strings you need to represent a similar range of numbers in those cases.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: binary arithmetic habits

Post by VolTeK »

Combuster wrote:It works the same for decimal, binary, octal, and whatever number range you want to perform - it just becomes simpler for smaller digits and is really straightforward in the binary case. It also works for decimal numbers if you know the caveats.
Combuster wrote: converting to decimal and back does seem to be much more memory efficient and less error-prone for most people

Thanks
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: binary arithmetic habits

Post by Love4Boobies »

I don't find this a useful skill to develop. I never find myself in the need to perform fast binary divisions and even if I ever did, I'd probably be in front of a computer.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: binary arithmetic habits

Post by VolTeK »

Love4Boobies wrote:I don't find this a useful skill to develop. I never find myself in the need to perform fast binary divisions and even if I ever did, I'd probably be in front of a computer.
Good point.
CrypticalCode0
Member
Member
Posts: 81
Joined: Wed Nov 09, 2011 2:21 am
Location: Behind a keyboard located in The Netherlands

Re: binary arithmetic habits

Post by CrypticalCode0 »

Intel used to have a great barrel shift which was used to divide and multiply....
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: binary arithmetic habits

Post by Brynet-Inc »

Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply