Tool to convert and calculate numbers in base -10, also called negadecimal base (positional numeral system in base minus ten)
Negadecimal - dCode
Tag(s) : Arithmetics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The negadecimal system is the name given to the positional numeral system in base $ -10 $ (negative/minus ten radix).
For every number $ N $ written in radix $ -10 $ and made of digits $ a_n, a_{n-1}, \cdots, a_1, a_0 $ then $$ N = \sum_{i=0} a_i \times (-10)^i $$ or the following calculation: $ N = a_n(-10)^n + \cdots + a_1(-10)^1 + a_0(-10)^0 $
To change the base from a decimal number (base 10) to negadecimal (base -10), apply the algorithm:
N = []
While (n != 0) {
r = n % (-10)
n = floor( n / (-10) )
if (r < 0) {
n += 1
r += 10
}
N = [r,N]
}
Example: $ 123_{(10)} $ go througn the steps: $ r = 123 % (-10) = -7 $, $ n = \lfloor 123/(-10) \rfloor = -13 $ as $ r < 0 $, $ n = -12 $ and $ r = -7 + 10 = 3 $ so the last digit is $ 3 $. Continue to get $ 823_{(-10)} $
To calculate the decimal value of a number in radix -10, apply the formula: $$ N = \sum_{i=0} a_i \times (-10)^i $$ with $ a_i $ the digits of $ N $.
Example: $ 789_{(-10)} = 7 \times (-10)^2 + 8 \times (-10)^1 + 9 \times (-10)^0 = 7 \times 100 + 8 \times (-10) + 9 = 629_{(10)} $
Negadecimal has the advantage of being able to store negative numbers without a minus - sign.
dCode retains ownership of the "Negadecimal" source code. Any algorithm for the "Negadecimal" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Negadecimal" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Negadecimal" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Negadecimal" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Negadecimal on dCode.fr [online website], retrieved on 2025-04-14,