# Questions tagged [number-representation]

Questions about interpretation of numeric input or how Mathematica stores and manipulates numbers internally.

141 questions
Filter by
Sorted by
Tagged with
148 views

### How to plot data that are already in scientific form? [duplicate]

I've got an array of data shown in scientific form. Which looks like this: x = {0.0001,ScientificForm[0.999890436521418]} Now I'm trying to use ListPlot to plot ...
81 views

### Calculating a 64-bit integer from 8 one-byte integers

I have 8 bytes expressed as integer values stored in a list. They correspond to a 64-bit counter with the lowest significant byte at first position. Here is an example what I am doing: ...
95 views

### StringTemplate does not respect NumberFormat

I am trying to write Latex report generator for my standard data analysis. But there is an issue with formatting numbers I can not get around. I would like to make use of my own ...
64 views

### How to switch a number back from AccountingForm? [closed]

I am working with a function that returns output in AccountingForm format. I would like to do math with that output, but Mathematica does not recognize it as ...
189 views

### Arbitrary-Precision Arithmetic behaves unexpectedly

I want to understand how small numerical errors propagate through a computation and may drastically change the final result. To this end, I consider a toy world in which every number is limited to ...
175 views

### How do I get Mathematica to write the coefficients of polynomial as fractions rather than decimal expansions? [duplicate]

I am trying to have Mathematica find the polynomial of degree $n$ in a single variable which fits the given points $(x_1,y_1),\dots, (x_{n+1},y_{n+1})$. In the examples I am concerned with, the ...
196 views

### find and count the number of solutions without multiplicity in Solve?

I would like to solve a Diophantine equation and find its solution, but I need only count one time for each $a$, i.e., when for some $a$ it found some $x,y,z$, then go to the next $a$. more precisely ...
429 views

### Representation of Rational Numbers

Following up on this question I would like to understand the way MMA represents rational numbers. First of all, as Carl Woll suggested, x/y is not a simple ...
678 views

### Understanding simple numerical calculation

I am trying to understand why N[0.1]//FullForm returns 0.1' (A). Indeed, $0.1$ in base two is $0.000110011001100110011...$. If I ...
108 views

### ExponentFunction not respected in NumberForm when typesetting zero?

Let's try to typeset a couple of numbers with a precision accuracy of 4: 04 14 10000004 I do not want the numbers returned with ...
85 views

### Dynamic Interpretation Button Label Loses Formatting on Copy and Paste

I have an Interpretation Button that displays its label correctly on evaluation. However, when I copy and paste it as input the ...
410 views

### How to format a number with an error?

I'm having a surprising amount of difficulty in trying to format some numbers with errors. I can't find any previous attempts to do this here or elsewhere and it would surely be of use to the ...
197 views

### Mathematica Input to get the exact form [duplicate]

Question: Is there a command in mathematica that can take a decimal input, and output it into its exact form? The question arose when I tried to use this command: ...
109 views

### Unexpected behavior from NumberForm of a matix [duplicate]

If I calculate the dimension of the matrix after NumberForm directly, then there will be something wrong ...
163 views

### Changing threshold for scientific notation from 10^6 so that InputField display is uniform

Related to but different from this question. I'd like my InputField to display scientific notation not only for numbers larger than one million, but also for ...
69 views

### e approximations [closed]

Can you help me? I'm writing program to calculate e with given percision (not using function from Mathematics) by using e=sum (1/k!) k=0 to infinity. I have this: ...
188 views

### Showing more decimals in number calculated in While loop

I'm new to Mathematica and am not sure why I cannot show more decimal points in a variable. I am using Newton's Method to find the zero's of a function and I'm trying to print the x value of the zero. ...
144 views

### Why 2^^1*^k does not work?

Table[2^^1*^k,{k,0,10}] This gives an error, why is that? Also this BaseForm[2 ** 1*^ #, 16] & /@ Range What is ...
139 views

### Rationalize error

The docs state that "Rationalize[x,dx] yields the rational number with smallest denominator that lies within dx of x." However, testing this out it appears to be false. ...
35 views

### Copy-pasting a floating point number [duplicate]

Here is a behavior of the Mathematica front end which confuses me. Type N[Sqrt] The displayed output is 1.41421 ...
408 views

### How to copy formatted numbers as MathML without quotation marks?

I have the following code: a = 6.08717*10^6; b = a/3; c = a*1.5; d = a^2; matrix={{a, b, c, d},{b, c, d, a},{c, d, a, b},{d, a, b, c}}; matrix // EngineeringForm ...
162 views

### How can I completely discard decimals after a set number of significant figures?

I have a number with a long decimal tail, like x=1.23456789789456123 and I would like to (i) keep the first $n$ significant figures, and (ii) completely discard ...
225 views

### How to round all the numbers in a function?

I have a complicated function that is a combination of floating-point numbers and variables. I want all the numbers rounded off, but I have no clue how to do this. For example I would want ...
125 views

### 4-digit number, where $d_{1000} \lt d_{100} \lt d_{10}\lt d_{1}$ [closed]

I need to find all 4-digit numbers, where ones-number > tens-number > hundreds-number > thousands-number. 6789 is the highest possible such number and 1234 is the lowest. One solution is to write them ...
123 views

### RealDigits and functional style

So while thinking about Replacing numbers of which you only know certain digits I have faced, again, a problem that I find hard to extract from RealDigits' output ...
185 views

### NumberForm pesky warning from Manipulate

I'm using the NumberForm command inside a Manipulate environment, and in some special cases Mathematica gives a pesky and mostly useless warning message : NumberForm::sigz: In addition to the ...
76 views

### How to refer a number in a list with two columns, first one is a number and the second one is empty? [closed]

Let's say, I have defined a list as list = {{-31, -31}, {52, }, {34, -11}, {-38, }, {78, -44}, {-36,14}, {-9, 98}, {33, 6}, {82, 99}, {-85, -10}} As you can see, ...
64 views

### Encoding/Decoding matrices as integers, integers as matrices [closed]

I want to convert large binary matrices of m x n dimensions into integers, and then to convert these integers to the original matrices. I attempted the following: ...
219 views

### How to get the $0$ result for this limit?

Consider the following series: $$\sigma (\text{x\_})\text{:=}\sqrt{\sum _{k=0}^{x-1} \frac{(x! x!) (-1)^{x-k}}{(x-k) (k! (2 x-k)!)}+\frac{\pi ^2}{12}}$$ From the following codes, it seems that the ...
59 views

### Pattern that matches numbers in the $\epsilon$-neighborhood of a given number?

I dfined the following function to create a pattern that matches the $\epsilon$-neighborhood of a given number. ep[x_, e_] := _?(x - e <= # <= x + e &) ...
88 views

### Maintaining working precision in my program

I am badly stuck with this program I am writing. I want output of program below to be precise up to 25 digits after decimal point. I am supplying all inputs with precision 25. But after each iteration ...
70 views

### Behaviour of RealDigits expected or wrong?

Is this behavior expected or a bug? RealDigits[10304.390456] {{1, 0, 3, 0, 4, 3, 9, 0, 4, 5, 5, 9, 9, 9, 9, 9}, 5} when I ...
272 views

### Making a replacement on the numerator and denominator of a rational number

It's isn't a big deal, but when I run the following I don't get the output I expect. After discussing this in the comments it appears it has to do with being an atomic expression. ...
282 views

### Calculations after NumberForm [duplicate]

As specified in documentation center the functions AccountingForm, NumberForm, etc. are useful only to display numbers in ...
100 views

### NumberLinePlot: How to make the 3rd list (c) appears with “black crosses” or “void circles”?

a = {1, 2, 5, 2} b = {2} c = {1.75, 2.88, 3.25} NumberLinePlot[{a, b, c}, PlotStyle -> Directive[PointSize[0.032]]] I thought about PlotMarkers or PlotStyle, ...
86 views

850 views

### What is the FullForm of 36^^sadjh.87s567*^-34?

The Mathematica parser parses and computes number literals before sending them to FullForm even if Hold is applied. Thus the ...
143 views

### Arithmetic on algebraic numbers

I'd like to perform some elementary operations on algebraic numbers. ...
261 views

### How can I improve NumberString?

I would like to test strings to see if they represent numbers. This should include number representations with precision marks and scientific notation. NumberString ...
243 views

### Is there a global setting for number form

I'm creating strings which represent equations in C to use with library link. The problem I have is that numbers in ScientificForm are no longer useful after they ...
131 views

### Testing for a vector of reals [closed]

Suppose I define: RealVector[expr_]:=VectorQ[expr,NumberQ[#]&&Head[#]===Real)]; Then: ...