The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [number-representation]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
64 views

How do I interpret numbers like 0``-24.779598336747533$ [closed]

A numerical calculation leads to the following strange output. I converted it to InputForm and it looks like this: ...
4
votes
1answer
121 views

Self-locating Strings in $\pi$?

According to The Pi-Search Page, in the first 100 million digits of $\pi$ the following numbers are self-locating: 1, 16470, 44899, 79873884. The following inefficient code (which also does not ...
0
votes
1answer
57 views

Displaying the repeating decimal expansion of a rational number [duplicate]

How do I write a decimal expansion of a rational number $a/b$ with only periodic part, e.g., given $1/7=0.14285714285714285714 \ldots$, I want just $0.142857$, the periodic part of $1/7$, to be ...
9
votes
4answers
2k views

Test if number represents an integer

I can't figure out how to test if a number is an integer. I have found IntegerQ, but this function only checks if the type of the input is an integer, not whether ...
2
votes
3answers
66 views

Find the number of true's in a TrueQ expression

How can I find how many times the code: Table[TrueQ[FractionalPart[Sqrt[n]] == 0], {n, 1, m, 1}] Gives the value True back for a variable $m$? So, we know that ...
0
votes
2answers
62 views

How to solve a problem using DensityPlot in a Hypergeometric function?

The problem is to obtain a DensityPlot of a Hypergeometric function The code is the following ...
0
votes
1answer
46 views

NumberForm with fixed width and exponent as “e+00” or “e-02”

I wish to export a matrix of real numbers out to a txt file in which the entries have the MatLab form: ...
1
vote
2answers
213 views

How to generate all the combinations? [duplicate]

There are $N$ optimization variables, $v_1,v_2,\cdots,v_N$. and $v_n\in{0,1,2,3,\cdots,K}$. Let $N=10$ and $K=5$. How can I generate all the possible combinations? For example, the first ...
7
votes
1answer
135 views

Problem to import numbers longer than 19-digit with “JSON” or “RawJSON”

Bug introduced in 11.0.1 or earlier and fixed in 12.0. MMA 11.0.1.0 (Windows 10, 64-bit) I see that "JSON" import can be buggy (154245), so my question is simple: can the following behaviour be ...
2
votes
1answer
52 views

Web Scraping - Why are these numbers interpreted as strings?

I started with: data = Import["https://www.destatis.de/DE/ZahlenFakten/GesellschaftStaat/Gesundheit/Todesursachen/Tabellen/Sterbefaelle_Unfaelle.html", "Data"] ...
8
votes
3answers
476 views

How to write an array of repeated numbers as a single number

Let's say we have a random number consisting of an arbitrary number of digits, such as for example 3097. This number can be represented as an array of repeated numbers with Mathematica by typing <...
0
votes
0answers
44 views

Ignoring text when converting strings of text to numbers

I have a string of measurements--mostly numbers, but occasionally an NA. Right now Mathematica is reading it all as text, so I'm using ...
53
votes
2answers
39k views

Entering numbers in Scientific Notation?

I need to play with a lot of powers such as 10^-3. 1E-3 does not work for it. Is there any short form for it?
4
votes
5answers
249 views

How to convert list of digits to number? [closed]

I have a list such as: a = {1, 2, 4, 3}; and I want to get the 'number' of the list. For this example, I want to get this number: ...
0
votes
0answers
35 views

Return the precision of the first non zero digit in a number for measurement error representation function

I'd like to return the precision of the first non zero digit in a number. The motivation is so that I can quickly construct my error notation which is the bracketed notation, e.g. $x = 1.234$ with ...
1
vote
1answer
361 views

Rounding a number to decimal places and keeping a trailing zero

It's often useful for me to round numbers to some decimal place for printing on a graph or figure. I usually do this by: ...
0
votes
1answer
52 views

How can I simplify an Irrational Fractional Expression in Mathematica

The expression is: $$\frac{4\surd3 + 5\surd2}{\surd48 + \surd18}$$ and its simplification is: $$\frac{3}{5} + \frac{4\surd6}{15}$$ How can I perform such simplification in Mathematica?
10
votes
2answers
395 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 ...
23
votes
7answers
3k views

Formatting a fraction as a mixed number

Is there a command that will take a rational number and rewrite it in a mixed-number-like form? That is, I'd like to apply a command to something like 10/7 and get ...
0
votes
0answers
41 views

Solving a system of linear equations in Mathematica regarding the errors of different methods

I have a system of equations, i.e. 0.62243x + 0.51824y = 0.70524 0.71497x + 0.59496y = 0.80996 I have 3 ways to solve this system (there are more but I am ...
4
votes
1answer
101 views

NumberForm and Precision

With MachinePrecision this construction works as expected ...
6
votes
1answer
274 views

Calculations after NumberForm [duplicate]

As specified in documentation center the functions AccountingForm, NumberForm, etc. are useful only to display numbers in ...
1
vote
0answers
109 views

LieArt — 3 different 8 dimensional irreducible representation of $\mathrm{SO}(8)$ and their decompositions

I am using the LieArt which you can download freely online https://arxiv.org/pdf/1206.6379.pdf There are three different 8 dimensional $\mathrm{SO}(8)$ irreducible representations, formally it is ...
2
votes
1answer
122 views

LieArt — 8 dimensional Irreducible representation of $\mathrm{SO}(8)$ and their decompositions - No.2

This is the followed up question of LieArt --- 3 different 8 dimensional Irreducible representation of SO(8) and their decompositions, Since $$ \mathrm{SO}(8) \supset \mathrm{SU}(2) \times \mathrm{...
4
votes
2answers
141 views

number format with fixed total digit

How to get an output of number form of a given TOTAL digit? For example, a total digit of 3, then one get 1.00 for 1. ...
5
votes
2answers
123 views

Early vs. late application of arbitrary precision

The following arbitrary-precision computations, in which arbitrary precision is applied early (to the inputs), both work as expected: ...
2
votes
0answers
86 views

Check the data of representations of Lie groups

Is there a way in Mathematica to check the data of representation of Lie groups? For example, the number of generators. the rank (or the dimension) of the representation matrices. and a list of all ...
1
vote
2answers
56 views

Issue with Internal`RealNumberQ in list: How to tell if a given element of a list is real-valued [closed]

I define a list of zeros to the equation $y(1-\frac{1}{2}y)^4=0.1$: zeros = NSolve[y (1 - 0.5*y)^4 == 0.1, y]; I can call/make the explicit list of solutions. <...
0
votes
0answers
47 views

Decimal representation in Mathematica 10

I am using a slider to assign the value for a dynamic variable x, and want to display the value of y=10^Dynamic@x in decimal ...
0
votes
0answers
39 views

Using Rationalize to find the exact rational form [duplicate]

When I run Rationalize[2.98688387095, 0] I get $\frac{117300079}{39271724}$ However, when I run N[117300079/39271724, 50] ...
1
vote
1answer
55 views

How to add 0 to right of decimal for exported numbers

I'm using Mathematica to process some grades which are saved via Export[]. However, if I have real versions of integers, the exported numbers don't have a trailing ...
2
votes
2answers
157 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 ...
2
votes
1answer
92 views

Extracting a product of factors from an expression in unevaluated form

Suppose I have an expression like so: $\qquad {\rm expr}=2\,i\,{\rm Gamma}(4)\,\pi\, 9.93 f(x)\,g(y) \frac{h(x, 4y)^3}{11 q}$ What is best (most succinct) way to extract out only the product of ...
64
votes
3answers
3k views

When can I assume that all decimal digits returned by Mathematica are provably correct?

How to Control the Precision and Accuracy of Numerical Results Arbitrary-Precision Numbers Mathematica works with exact numbers and with two different types of approximate numbers: machine-...
2
votes
1answer
105 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 ...
1
vote
1answer
92 views

Strange numerical values [closed]

I have a table of numerical values which contains a lot of strange values. ...
2
votes
1answer
175 views

Number of digits problem

Why the following code Table[ N[i, 4], {i, 1, 2, 0.5}] do not output numbers with fixed number of digits, but gives this ...
8
votes
1answer
187 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 ...
1
vote
0answers
163 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 ...
0
votes
0answers
43 views

representing decimals with commas instead of dots [duplicate]

I want the decimal numbers in the axes of my graphs to be represented with commas instead of dots Is it possible? Does anyone know how to do it? I've made a few research, but I've got no answer. ...
4
votes
2answers
320 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 ...
9
votes
3answers
961 views

Mod[1.2, 0.2] is not equal to zero

Why doesn't the following expression evaluate to zero? In[1]:=Mod[1.2, 0.2] Out[1]=0.2 Edit: This is what I wanted to do: ...
1
vote
2answers
106 views

How can I simplfy the result of Eigenvalues? [duplicate]

As we know, the eigen vectors and eigen values of a real symmetric matrix always is are real numbers. I am trying to use the Mathematica to verify this theory. Suppose I have a matrix ...
5
votes
3answers
184 views

Dynamically updated AccountingForm

Bug introduced in 10.4 or earlier and persisting through 11.1.1 CASE:3918306 confirmed I freshly installed Wolfram Mathematica. I can't quite remember how to output a dynamically updated variable ...
1
vote
2answers
413 views

Number format of plot legend

How can I change format of numbers for bar legends. I would like to show numbers without digits after the decimal point. ...
0
votes
0answers
66 views

Can FindFormula or FindSequenceFunction be used to identify a formula for a number? [duplicate]

This is closely related to: https://math.stackexchange.com/q/2361727/10063 and is a new version of Can Mathematica propose an exact value based on an approximate one?. In Wolfram|Alpha I can input ...
2
votes
1answer
82 views

Why N[vector[[j]]] or NumberForm[vector[[j]]] not working? [closed]

Why is N not giving the approximate result (removing the .)? vectorj = Table[j, {j, 0, 0.1, 0.01}] N[vectorj[[1]], 0] (*out=0.*) or ...
0
votes
1answer
85 views

Why is NumberForm not good with ListPlot? [duplicate]

Is NumberForm not good with the following use of ListPlot? Look at my example: vectorj = {Rationalize[0.3],NumberForm[1.2131, 2]}; ListPlot[vectorj] This is ...
0
votes
2answers
45 views

How can I retrieve an element of an array created with Range? [duplicate]

I have the following Mathematica code where I create a linearly spaced array of numbers and try to retrieve the third element: ...
6
votes
5answers
1k views

How to get exact Rationalize of a decimal number?

This is on Mathematica 11.1 on Windows 7. I have this value 0.97646105481464028 which I'd like to get exact rational for it. I have thought that every terminating ...