# Questions tagged [base-conversion]

Conversion of numbers between positional numeral systems. Most common systems are decimal, binary, hexadecimal etc.

179 questions
Filter by
Sorted by
Tagged with
1k views

### Carry-less sum given a base b

Given a list of positive integers $\mathcal I=I_1,I_2,I_3,...,I_n$ and a base $b>1$ return their "carry-less sum", i.e. represent $\mathcal I$ in base $b$ and sum digit-by-digit ...
• 9,258
2k views

### Convert from variable-width Two's Complement to Integer

Take an input, and convert it from Two's Complement notation (binary where the first bit is negated, but the rest are taken as normal) into an integer (in a somewhat standard output form). Input can ...
• 1,306
3k views

• 22.6k
998 views

### Bijective meets mixed base

Background A bijective base $b$ numeration, where $b$ is a positive integer, is a bijective positional notation that makes use of $b$ symbols with associated values of $1,2,\cdots,b$. ...
• 66.1k
2k views

### How long is the number in this base?

Given a positive integer $n$ and another positive integer $b$ ($1 < b < 36$), return the number of digits/length of $n$ in base $b$ ...
• 113
693 views

• 9,836
3k views

### Convert negadecimal to decimal (and back)

Negadecimal, also known as base -10, is a non-standard positional numeral system. Take the number $1337_{10}$. In decimal, this has the value one thousand three hundred thirty seven, and can be ...
• 17.9k
2k views

### Display the exponent from a binary floating point number as a decimal value

Had my software final exams recently, one of the last questions had me thinking for a while after the exam had finished. Background IEEE754 numbers are according to the below layout The exponent is ...
718 views

• 16.5k
2k views

### Digital Sumorial

Given an input n, write a program or function that outputs/returns the sum of the digital sums of n for all the bases 1 to ...
• 7,638
746 views

### convert decimal to duodecimal

The task is to convert a string representing a number in decimal (base 10) representation to duodecimal (base 12). The input is thus a string, the output should be printed. The input number can be ...
• 125
799 views

### Permutation Encoding

Write a program which can encode text to avoid reusing characters, and convert back. Both normal and encoded forms are restricted to a particular character set: the space character ...
• 409
2k views

### Custom Number Base Converter

The powers that be want to be able to quickly convert any number they have into their own number base using any format they would like. Input Your program must accept 3 parameters. Number: The ...
3k views

### Increment base-36 strings

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle. Given a string of length 10 which represents a base 36 number, increment it by one ...
• 331
4k views

### ASCII art uncompression from a base-n number

This is inspired by an 05AB1E answer by Magic Octupus Urn. Given two arguments, a positive integer and a string/list of characters: Translate the number to base-n, where n is the length of the ...
• 46.4k
150 views

### Divide them all [duplicate]

A Math.SE user have a funny game explained as such: Pick a random positive integer X. Add +1, 0, -1 to make it divisible by 3Keep track of how much you've added and subtracted. That is your "...
• 287
1 vote
211 views

### Hexadecimal, octal, binary, oh my! [duplicate]

This is a code golf puzzle: shortest byte count wins. The program should do the following (standard loopholes obviously forbidden): Input a hexadecimal number Convert to octal Then interpret the ...
• 17.9k
485 views

### What are these letters?

So what might be the shortest language for this simple task? Task: You are given an input of type String - the string is a ...
• 792