[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 99 KB, 561x595, 1369680341730.png [View same] [iqdb] [saucenao] [google]
5937888 No.5937888 [Reply] [Original]

Hey /sci. Im trying to come up with an algorithm to put into a flowchart that converts a base 10 number to a base 2 number. Any idea on how to go about this?

I know you would have to divide the base 10 number by base 2 until its completely broken down, but how would you represent storing the remainders in flow chart form and then displaying them from the bottom up to represent the base 2 form? Any ideas?

Pic unrelated.

>> No.5937897

If you can't make an algorithm that simply changes a number's base. You're simply fucking retarded.

>> No.5937916

>>5937897
Or, I'm new to the subject ya fucking dick hole. It's not that I don't know how to convert number bases, I want to put it into a flow chart and that's where my problem is.

and if you don't know how to properly use commas in your sentences, you're simply fucking retarded.

Go put on your fedora and sit in the corner while the big kids have a discussion.

>> No.5937922

>>5937897

There is an effective procedure for changing bases.
Therefore the algorithm exists.

What did you think you were saying?

>> No.5937928

>>5937916
The period instead of the comma puts more emphasis on the latter clause, you fucking retard.
You cannot into algorithms/logic and now, it turns out you can't even into simply linguistics. I feel bad for you.

>> No.5937974

>>5937928
>>5937897
Ah, I feel like an insecure condescending bitch and feel bad for you.
We all start somewhere and every one who know as much as me in computer science (Which isn't that much. I study math) passed through this phase at least once.
I'm sorry for acting like an unnecessarily aggressive and condescending bitch. Here is a bump.

>> No.5938010

>>5937888

i=0
B=1
while B<x
{
2*B -> B
i+1 -> i
}
while x>0
{
if B>x
{
B/2 -> B
i-1 -> i
}
else
{
x-B->x
1 -> b_i
}
}

>> No.5938016

>>5938010
while x>0
{
i=0
x%2 -> b_i
x/2 -> x
i+1 -> i
}

>> No.5938024

>>5937888
For a geeneral approach, have alook here
http://www.cut-the-knot.org/recurrence/conversion.shtml

I'm always impressed by these guys>>5937897
If you have nothing else to do than spending your time posting such comments, what enjoyable should be your life...

>> No.5938077

>>5937897
For an image hosting site to be centered around learning and intelligence, such as /sci, you sure find a lot of fucking jerkoffs here.

>>proof

>> No.5938847

To express a positive integer N in base B:

Set P=0.
Set W=N.
While W>0
Set D=W%B. This is the "B^P"'s digit.
Set W=(W-D)/B
Set P=P+1.
End

That's it. Here W%B is the remainder when you divide W by B.

Example: express 11 in base 3.
N=11, B=3
P=0, W=11.
D = W%B = 11%3 = 2. This is the B^P = 3^0 = 1's digit
W=(W-D)/B=(11-2)/3=3
P=P+1=0+1=1
D=W%B=3%3=0. This is the B^P = 3^1 = 3's digit
W=(W-D)/B=(3-0)/3=1
P=P+1=1+1=2
D=W%B=1%3=1. This is the B^P = 3^2 = 9's digit
W=(W-D)/B=(1-1)/3=0
P=P+1=3.
Done, since W=0. Thus 11 is 102 in base 3.