Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

**Philip II****Member**- Registered: 2010-08-07
- Posts: 3

I have zero experience with computers outside the webnets and HTML. How would I make a code that converts a base 3 number (such as 2011) to a base 10 number (58)? Would it have a limit to its compacity (outside of my computers processing power)?

Thanks!:D

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 96,639

Hi Philip II;

I don't recommend being shown this conversion. I think it is a very important step in a beginners computer education.

The method to convert follows directly from the representation of the number in base 3. Starting from the right and working left.

Do you see a method now?

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**MathsIsFun****Administrator**- Registered: 2005-01-21
- Posts: 7,560

This may also help: Base Conversion Method

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman

Offline

**Philip II****Member**- Registered: 2010-08-07
- Posts: 3

I understand the process. What I need is a code that does it for me. I don't have time to convert 300-400 digit long base 3 numbers. I know it sounds ridiculous that I need numbers that large in base 3, but I do

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 96,639

Hi Philip II;

You need to learn a programming language to start. Then you can do it yourself or just google for a base conversion program.

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**Philip II****Member**- Registered: 2010-08-07
- Posts: 3

Really that's your advice? "Learn computers"? Couldn't one of you excellent coders just provide me with the code?

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 96,639

Really that's your advice? "Learn computers"

No, that is not what I said! Not learn computers, learn a programming language. At least have one installed so you can run code!!!!! It wouldn't hurt to learn something.

Couldn't one of you excellent coders just provide me with the code

Code for what? What languages do you speak? What languages do you have access to. Do you have some dialect of BASIC. QBASIC, Liberty Basic, Visual Basic? Do have a Borland C++, Microsoft C, GNU C? Delphi, Lisp, Forth, Python on your machine, what?

You just don't get code, code has to be interpreted or compiled by some language

bobbym wrote:

just google for a base conversion program.

That was good advice there are probably 100 such programs for download on the internet right now. They are execs and you just have to run them.

If you can't program and don't have a language on your machine to compile code given to you. Then you must Google for a program that does it for you. Do you know how to google?

Perhaps you are going to have to learn a little bit about computers, the internet, downloading, compilers etc.

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**MathsIsFun****Administrator**- Registered: 2005-01-21
- Posts: 7,560

As bobbym suggests, first you need a language to code in. You can, for example, use actionscript to make flash animations, or PHP, java, javascript etc to make code for a website, C. C++, VB.net, etc to make desktop applications, just to name a few.

Perhaps you could let us know a bit more about what you need it for?

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman

Offline

**Gameguru****Guest**

//C++ FUNCTION:

//base_convert

//arguments:

//iNumber = number to convert from

//iBase = base to convert to

int ConvertBase (int iNumber, int iBase)

{

int iResult = iNumber % iBase;

int iMultiplier = 10;

while((iNumber /= iBase) > 0)

{

iResult = (iNumber % iBase) * iMultiplier + iResult;

iMultiplier *= 10;

}

return iResult;

}}

This code will not compile by itself.

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 96,639

Hi;

Maybe my vision is not so good but have you counted your left and right brackets?

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**soroban****Member**- Registered: 2007-03-09
- Posts: 452

. .

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

. .

. .

.

Offline

Pages: **1**