2
$\begingroup$

I need to convert some really big numbers from base-10 to base-8. All online converters I found cap the conversion at around 20 digits. Are there any downloadable programs with no digit limit? I'm running Windows 10, but Linux or Mac are possibilities if necessary to accomplish this.

$\endgroup$
  • 2
    $\begingroup$ Did you try Wolfram|Alpha? $\endgroup$ – Somos Jun 30 '18 at 2:52
  • 2
    $\begingroup$ You need something that uses arbitrary precision integers. Python will do that, as will Mathematica and (I believe) Maple. If you don't have access to those, you can roll your own in a spreadsheet. Put a number of your digits into each cell horizontally, then implement the carries in the formulas. How many digits are in your numbers? Only hundreds or millions? Or a googol? $\endgroup$ – Ross Millikan Jun 30 '18 at 2:56
  • $\begingroup$ @Somos Yes, it reached its limit. $\endgroup$ – abcjme Jun 30 '18 at 3:01
  • $\begingroup$ @Ross Millikan In the tens of thousands of digits range. I have no experience with any of those computer languages. Are there any already-made scripts? $\endgroup$ – abcjme Jun 30 '18 at 3:03
  • $\begingroup$ Okay, I should have asked this first. What do you mean you have really big numbers? Are they in a file? What is the file format? Why do you need to "convert" to base 8? What will you do with the converted number? $\endgroup$ – Somos Jun 30 '18 at 3:06
3
$\begingroup$

Python (the programming language and environment, you can download the IDLE environment on Windows, e.g.) has support for arbitrary precision integers (bigint) natively. It's not hard to convert bases using this (oct and hex are built-in functions). One can easily make a command line tool to do this (e.g. to treat numbers stored in a file if size is too large to write the numbers on the command line).

On MacOS and most Linuces python comes pre-installed. So nothing to do there.

It's free, easy to learn and requires no internet connection (as opposed to online tools). Check it out.

$\endgroup$
  • $\begingroup$ Yes, I found out that Python does this extremely well with: format(x, 'o') where x is the integer. $\endgroup$ – abcjme Jun 30 '18 at 15:50
  • $\begingroup$ @abcjme yes, that’s another way to do it. I’m a Python fan. It’s my go-to calculator tool $\endgroup$ – Henno Brandsma Jun 30 '18 at 16:04
2
$\begingroup$

If I understand your problem, the GPL program PARI-GP can handle arbitrary length integers (given enough memory of course) and can convert integer $x$ to integer base $b$ using the function $\texttt{digits(x,b)}$. It can read decimal numbers from a text file. For example $\texttt{readvec("num.txt")}$ returns a vector of the numbers from the file which has at most one number on each line.

One advantage of $\texttt{gp}$ is that you can download it as a single stand-alone executable file on Windows and run it interactively from the command line.

$\endgroup$
  • $\begingroup$ I couldn't get PARI to work. However, I found that Python works extremely well for this. $\endgroup$ – abcjme Jun 30 '18 at 15:46
1
$\begingroup$

So I found this calculating tool which might work for you.

http://wims.unice.fr/wims/wims.cgi

I tried using it and I typed a lot of random digits and it could convert them.

You could just copy and paste your number into the converter, but if the number is very large the number would go off the screen but you can scroll right to select and copy the new number.

enter image description here

Requires no downloading

$\endgroup$
  • $\begingroup$ That also had a cap, though much higher than most. $\endgroup$ – abcjme Jun 30 '18 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.