# Questions tagged [arithmetic]

Questions on arithmetic operations in Mathematica.

65 questions
Filter by
Sorted by
Tagged with
180 views

### Applying Mod on list of list with outcomes +1, -1, other

I have a list lis = {{7, 8}, {17, 9}, {11, 10}, {12,10}} I want to apply Mod to each pair with output +1,-1 or ...
334 views

### Improving Map Function on Lists

Dealing with spectral data (2D lists) where offsets (corresponding 1D list) must be removed from each individual spectrum. Looking for feedback on improvements over my current method. ...
97 views

### Why Divide does not give the same answer? [closed]

I saw a question on Facebook $8\div2 (2 + 2)=?$ Consider these inputs. Divide[8, 2 (2 + 2)] 1 $8\div2 (2 + 2)$ using esc+div+esc 16 Why the results are ...
47 views

### Mathematica doesn't evaluate/simplify arithmetic expression in its output [closed]

I have two matrices, A := {{1, 2, -4}, {2, -2, -2}, {-4, -2, 1}} and ...
43 views

### Generating columns in table and header for exported data file automatically

I have a code that goes like this: ...
60 views

### Force computation on IEEE float/double

I'm checking two different procedures that will eventually be used with regular floating point arithmetic. I need to estimate numerical error arising from floating point arithmetic. Is there a way to ...
60 views

### Forcing divisions to be a machine-precision floating point divisions instead of multiplication by inverse

I want to imitate machine-precision, de facto IEEE division on Mathematica. On my quick trials I find this surprisingly hard to accomplish, since Mma rewrites a / b ...
163 views

### How to form subgraphs from a connected graph

I have a connected graph with 72 nodes and its binary adjacency matrix. I need to find all possible connected subgraphs with exactly 6 nodes, i.e., I need to find all connected subgraphs and each ...
59 views

### Roots of an algebraic expresion [duplicate]

If in WolframAlpha I put (-8)^(2/3) then it outputs the main root and 3 roots solution too (to the end in a polar graphic). How can I get the 3 root solution of <...
172 views

### multiply two vectors, component by component [closed]

Would like to take two vectors and multiply components at the same index.For example {a1, a2, a3} x {b1, b2, b3} to produce {a1 b1, a2 b2, a3 b3}. The following works, but are there some alternatives?...
93 views

### Raise a table of pre-existing data to the power of of one of the variables

NOTE: I have edited this question to give a table whose first elements don't count up from 0 to 5. I'm using a sample table ...
84 views

664 views

162 views

### Sum of Integers with a Pure Function

How would I find the sum of an argument, with the constraint that they are all integers (so if the argument contains a non-integer value, the function will not evaluate). I came up with these two: ...
135 views

### Pure Function that adds all arguments

the question asks to create a pure function that adds any number of arguments. Is the following acceptable? sum := Plus[##] & It does work, but can it be considered a pure function? I felt like ...
102 views

### Does Mathematica always return a rational number in its simplified form? [closed]

If I enter: 1/RandomInteger[10^200]+1/RandomInteger[10^200] I get (instantly) an exact fraction. Is this fraction in simplified (reduced) form? In other words is ...
2k views

### Permanently rounding numbers/values to a given number of significant figures

I am searching for a simple way of rounding and setting an input to a desired number of significant figures. There are a vast number of posts that discuss similar problems, but none address this issue....
110 views

### Why I'm getting 9999s after decimal and how do I fix it? [duplicate]

Check the screen shot. Why I'm getting 999s? It is suppose to be 127,977.52 Thanks in advance, Quick solution: AccountingForm[58156.48 + 69821.04, 16] And thanks to Yves Klett
869 views

### Product of elements of a list

Sum is for functions; Total is for a list. Product is for a function; what is the command ...
64 views

### A problem with getting a coefficient

I try Coefficient[E^(I a (t - b)), E^(I a t)] and expect the output E^(-I a b) but in fact I get ...