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

learn more… | top users | synonyms

0
votes
0answers
30 views

Copy-pasting a floating point number [duplicate]

Here is a behavior of the Mathematica front end which confuses me. Type N[Sqrt[2]] The displayed output is 1.41421 ...
4
votes
1answer
84 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 ...
1
vote
2answers
43 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 ...
0
votes
1answer
53 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 ...
4
votes
0answers
71 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 ...
0
votes
1answer
67 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 ...
1
vote
1answer
59 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, ...
1
vote
2answers
118 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 ...
2
votes
1answer
34 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: ...
1
vote
1answer
50 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 &) ...
0
votes
0answers
41 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 ...
5
votes
2answers
157 views

How to make pairs of Young diagrams appear?

I have the following Young diagrams {{{0}, {2}}, {{0}, {1, 1}}, {{1}, {1}}, {{2}, {0}}, {{1, 1}, {0}}} where you can interpret each pair as following: For ...
7
votes
2answers
288 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
1answer
60 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 ...
1
vote
3answers
157 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. ...
1
vote
1answer
76 views

Calculations after NumberForm [duplicate]

As specified in documentation center the functions AccountingForm, NumberForm, etc. are useful only to display numbers in ...
1
vote
3answers
125 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 ...
1
vote
1answer
51 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, ...
2
votes
1answer
57 views

How to insert a character in a string with condition?

Considering we have a string: str = "1a 789 4/7 123/7 asff %$#7 478 9/4" How can I insert "/1" for the numbers that are ...
1
vote
1answer
190 views

Something wrong with FromDigits?

NestList[RotateLeft, IntegerDigits[19], 1] FromDigits[%] (* WRONG *) ...
0
votes
0answers
81 views

How to parse fraction to a number?

Considering a fraction: val = "F \!\(\*FractionBox[\(1\), \(1\)]\)"; I extract the part of interest: ...
2
votes
1answer
87 views

Converting a quantity to a decimal form [closed]

I have a function giving me this: (5 Coulomb)/(6 Second) as output. I want this in decimal form and would like to have the variables taken off the end for unit ...
11
votes
5answers
243 views

Tidy form of numbers with errors using ScientificForm

Say I've computed something and got a number 0.02112398 with a computed error: 0.000331 Formatting it with ScientificForm[0.02112398 \[PlusMinus] 0.000331] gives me:...
5
votes
2answers
149 views

Showing AlgebraicNumber[1/2 (1 + Sqrt[5]), {-3, 2}] in human-readable way

Is there a function to show algebraic numbers in Mathematica more conveniently? I am looking for something similar to MatrixForm for matrices. For example, I would like to view ...
1
vote
0answers
66 views

How can I perfect this game for Wolfram Demonstration publication? [closed]

When the messages change the window inactivates, and when I try to host an interactive CDF on my site it turns red and says something about numbers having to be scaled or offset. Any help? I'm ...
0
votes
1answer
91 views

Why does my function return an expression rather than a number? [closed]

I feel like I'm going insane. I have a function $f(x)=e^{-x^2}$ which I need to evaluate using forward, backward and central first order finite differences with intervals ...
0
votes
1answer
81 views
4
votes
3answers
293 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 ...
0
votes
1answer
242 views

Converting strings of the form “1.34e5” to real numbers? [duplicate]

ToExpresssion doesn't understand real numbers of the form "1.34e5". How do I convert the string ...
1
vote
2answers
94 views

Arithmetic on algebraic numbers

I'd like to perform some elementary operations on algebraic numbers. ...
5
votes
3answers
201 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 ...
2
votes
3answers
106 views

Testing for a vector of reals [closed]

Suppose I define: RealVector[expr_]:=VectorQ[expr,NumberQ[#]&&Head[#]===Real)]; Then: ...
22
votes
3answers
754 views

Real Numbers in the Wolfram Language

Epilog: Much of the discussion in the answers below revolves around the distinction between Real as a data type and real numbers as a domain or class of numbers (irrespective of the form in which ...
1
vote
1answer
279 views

create a function that converts a character string consisting of lowercase letters of the english alphabet to a number

I need a function that will take input as a string of lowercase letters and then output integers in this form a=01 b=02 c=03 d=04 e=05 . . . z=27 The letters must correspond with these integers ...
5
votes
2answers
146 views

Display All Output Numbers in HEX

How might I modify Mathematica such that I can get the following functionality when working with HEX values. The odd lines are input and the even output. Red values should be the HEX values. ...
2
votes
1answer
81 views

Range and decimal digits [duplicate]

When I set Plot[Sin[x], {x, -2, -1}, Frame -> True, Axes -> False, FrameTicks -> {{Automatic, Automatic}, {Range[-2, -1, 0.2], Automatic}}] I ...
6
votes
6answers
198 views

Join decimal part

I have a list of mesures that each vector is like {0,1,-2,259} but it should be like {0.1,-2.259} So I did a rule, like ...
1
vote
1answer
105 views

How can I export numerical data in a calculation-favorable format?

I am exporting some data into the txt file but since the values exported to this txt file expresses 10^6 to be *^6, I cannot use these numbers in calculations in other programs.. For instance, when I ...
3
votes
3answers
366 views

Customizing decimal mark used in plot frame tick labels

I am using the Plot function in a usual way. I use Mathematica 9.0.1.0 in English (I do not know if it is available in other languages, but I do not mind), and as a ...
3
votes
1answer
109 views

Is there a `Real` equivalent to `FromDigits`?

One can extract an Integer's digits using IntegerDigits and reassemble them into the Integer ...
13
votes
4answers
3k views

How to implement Donald Knuth's up-arrow notation

How does one enter very large numbers in up-arrow notation? Up-arrow notation was created by Donald Knuth to write very large numbers in it iterated exponentiation form, for example 6↑↑3 = 6^6^6.
6
votes
1answer
258 views

Machine Epsilon

I'm trying to evaluate the machine epsilon of my computer (see below). I wrote this: ...
1
vote
0answers
240 views

How to work with large numbers

How do I browse very large numbers in mathematica, say $10^{{10}^{{10}^{1.414\ldots}}}$? By browse I mean finding the $k$th decimal place before or after the decimal point. Everything I have tried ...
3
votes
2answers
568 views

Enter exact rational numbers easily with decimal notation

Is there a simple way to enter decimal numbers such as 0.123 so that Mathematica interprets it as an exact rational number 123/1000?
0
votes
2answers
142 views

The precision of the number

I have problem in Mathematica with unnecessary rounding which is caused by high precision. For example I have value a = 2.052685846*10^-1865, when I make ...
0
votes
1answer
94 views

Square root of a value defined in a finite field?

I am trying to find the right way to compute the square root of a number defined in a finite field. For example, ...
5
votes
0answers
175 views

NMinimize seems to call function with the same values multiple times

I have to minimize a function where the evaluation of one parameter set takes very long (around 5sec) and discovered alongside, that NMinimize seems to call this ...
8
votes
1answer
253 views

Is it possible to lower the bitwidth of (floating point) numbers?

The answer to this question will most probably be a definite no. Nevertheless, I would like to know whether it is possible to represent reals in the memory on less than the standard 32 or 64 bits (...
0
votes
2answers
71 views

Function that returns the binary string given its index in lexicographic ordering

Index the binary strings in lexicographic order, so that the empty string " " corresponds to 0, the string "0" corresponds to 1, the string "1" to 2, and so on. I want a function that, given a ...
13
votes
1answer
9k 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?