Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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: ...
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 ...
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
214 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 ...
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"] ...
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 ...
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
370 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: ...
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
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?
0
votes
0answers
42 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
102 views

NumberForm and Precision

With MachinePrecision this construction works as expected ...
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{...
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 ...
4
votes
2answers
142 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
88 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 ...
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 ...
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 <...
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
56 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
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 ...
1
vote
1answer
92 views

Strange numerical values [closed]

I have a table of numerical values which contains a lot of strange values. ...
7
votes
1answer
136 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
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 ...
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. ...
1
vote
2answers
414 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 ...
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
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 ...
4
votes
2answers
321 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
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
1answer
84 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: ...
0
votes
1answer
70 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 ...
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 ...
4
votes
2answers
475 views

Is there a command that does exact numerical conversion of non-exact to exact numbers?

I generally prefer to do all my intermediate calculations with exact numbers, and then round my result at the end. Thus I will typically convert each arbitrary-precision number to its exact equivalent;...
2
votes
2answers
118 views

How to directly use formatted numbers (e.g. AccountingForm) in calculations?

The documentation for AccountingForm states: AccountingForm acts as a "wrapper", which affects printing, but not evaluation. However, ...
2
votes
1answer
144 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 ...
1
vote
1answer
74 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: ...
4
votes
2answers
94 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 ...
0
votes
1answer
63 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 ...
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 ...
0
votes
1answer
166 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 ...