Hi..
Can any 1 help me in figuring out how to implement division for arbitrary sized integers ?
I have implemented + , - , * operators..
i am unable to figure out how to implement long division ..
Any help would be appreciated :-)
Thanks !
Hi..
Can any 1 help me in figuring out how to implement division for arbitrary sized integers ?
I have implemented + , - , * operators..
i am unable to figure out how to implement long division ..
Any help would be appreciated :-)
Thanks !
I think we can do division operation by using bitwise right shift operator.
Ex:
x=10
x/2 it will give 5
x>>2 also gives 5.
How machines do it
Clusty Search » binary division
How people did it
Clusty Search » long division
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.