Questions tagged [number-bases]

Tag for questions about using various number bases in Mathematica. This includes, but is not restricted to base notation, base conversion and formatting issues.

24 questions
Filter by
Sorted by
Tagged with
41 views

Why ImportByteArray when generate image from bytes

I was trying to generate an image from a list of bytes so I only had to Import an Image once as I want to store a Base64Encoded ...
42 views

How do I check if the base-$b$ representation of my number contains the same digits?

I came up with the following exercise with the intention of learning Mathematica but I am already stuck in the beginning. Let $n,b$ denote positive integers with $n>0$ and $b\geq2$. My aim is ...
152 views

Splitting a binary number into smaller parts and converting each smaller part back to decimal

This is my first Mathematica post and I would be obliged if you could be patient with me. I have the following large binary number $1111010010001001100011010101111110000101101110110011100101$ which I ...
160 views

The binary of negative integer number

I have a question about the binary of negative integer number in Mathematica. In most implementations, negative signed integers are stored in what is called two's complement. The other major way of ...
314 views

Using FromDigits to convert number strings to numbers

I've loved mathematics for a very long time but am only now beginning my journey to learn to code. The attached image shows the two different outputs (out-5, out 6) for a simple crypto-cypher I'm ...
155 views

Integer to Alpha Representation [duplicate]

I wanted a nice way to convert natural numbers to alphabetic representations like: ...
120 views

Base 12 input and output without ^^ or BaseForm

I would like to be able to enter numbers and have them interpreted in base 12 and output in base 12. For example, I want 13+A to produce ...
69 views

Find a number's digits in an arbitrary base [closed]

I want to write a program in Mathematica which for an input $n$ gives me a representation in a number system of base 26. For example, $$1419=2\cdot 26^2+2\cdot 26+15.$$ The output I am looking for is ...
132 views

convert the BaseForm of 2 (binary data) to an array

How do we convert the BaseForm of 2 (binary data) to a set of number correspond to the their BaseForm in terms of an array. For example, ...
95 views

Function for converting to base b, taking derivative with respect to b and evaluating at b

I am relatively new to Mathematica and I would like to program a function taking 2 variables in and giving 1 output. I think the best way to describe the function is like so: Given a base 10 number x ...
60 views

No function to enter value in a different base?

I notice that there is a syntax to enter a numeric literal in a different base, for example: In[8]:= 5^^1000000000000101 Out[8]= 30517578151 However, there does ...
81 views

How to preserve real number's precision

RealDigits[523.502] gives me {{5, 2, 3, 5, 0, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}, 3}. Is there a way in run time to tell ...
53 views

What is the preferred way to go from a non-decimal basis to a decimal basis?

We can insert a number in a basis different than 10 using the basis^^number expression. However, strangely enough, there does not seem to be a corresponding ...
396 views

Infinite base two number to base ten

Suppose I have a base two number that repeats itself every five places (a number $x$ such that $0\le x<1$. For example: $$x=0.101011010110101101011010110101101011010110101...$$ What would be a ...
82 views

Select base and exponent of arbitrary number

I want to write a function say BaseExponent that will output the base and exponent of a number. In particular it should do the following: ...
258 views

How to print of all ternary number of 100 digits?

For example, to print all ternary number of 3 digits I would do something like this Do[Do[Do[Print[i, j, k], {k, 0, 2}], {j, 0, 2}], {i, 0, 2}] to return 000, ...
96 views

Is the arbitrary base that can be defined by IntegerLength[n,base] really limitless?

I am going to be working with very large numbers, and would like write the input in the base 10 and have the computer output in another arbitrary base. If it truly is limitless, that would be awesome ...
973 views

View the FullForm of ^^

Why am I unable to see the FullForm of ^^ (the shorthand notation for BaseForm)? ...
430 views

I find using BaseForm to be a little tricky. For example, if you use BaseForm and then do some additional operation all the numbers turn back into base 10, so you have do BaseForm as the "last step". ...
183 views

Truncate a fractional value to particular number of bits?

If I have a fractional value, how can I truncate (not round) that to a certain number of bits, like 8? For example, for Pi 3.141569265359... the fractional part is 0.141569265359... ...
607 views

How do I remove the subscript after calling BaseForm[]?

Say I want to convert some number $N$ to base $k$. Here, I might use the command BaseForm[N,k], e.g.,BaseForm[10,...
7k views

How to convert from base 2 to base n?

I'm trying to use baseform to convert numbers in base 10 to base n, how can I make the convertion between, say base 2 to base n? Baseform seems to always think that the base in expr ...