Computer Science Canada Decimal to Binary |
Author: | heesoup [ Sun May 31, 2009 9:08 pm ] | ||
Post subject: | Decimal to Binary | ||
What is it you are trying to achieve? Convert a base 10 number to binary. What is the problem you are having? The answer seems to be incorrect. Describe what you have tried to solve this problem I know that I have to invert the digits for the answers for the right binary answer...but...how..? Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using the newest one I think.. |
Author: | Diablo117 [ Sun May 31, 2009 9:18 pm ] | ||
Post subject: | Re: Decimal to Binary | ||
Your remainder constantly changes. If you put the remainder inside the loop, you will see that the digits do in fact appear. What you need to do is store the remainder in reverse order : for example astring := astring+intstr(remainder) that should be inside your loop. it isnt in reverse order but I leave it up to you to figure that out. if your too lazy to think:
|
Author: | TW iz Rippin [ Tue Mar 20, 2012 11:02 am ] | ||
Post subject: | RE:Decimal to Binary | ||
|
Author: | Raknarg [ Tue Mar 20, 2012 11:54 am ] |
Post subject: | RE:Decimal to Binary |
TW, dont necro post. Notice how this topic is dated back in 2009. |
Author: | TW iz Rippin [ Wed Mar 21, 2012 10:40 am ] |
Post subject: | Re: RE:Decimal to Binary |
Raknarg @ Tue Mar 20, 2012 11:54 am wrote: TW, dont necro post. Notice how this topic is dated back in 2009.
my bad didnt see that |