Questions on arithmetic operations in Mathematica.

learn more… | top users | synonyms

0
votes
2answers
72 views

intermediate steps of a Mathematica operation

How to make a multiplication or division, the intermediate steps. The numbers can be rational - decimals? it seems the OP merely wants Mathematica to show him how to multiply and divide the way ...
6
votes
2answers
615 views

How to do binary calculation´╝č

For example, $a=0.10101$ in binary representation. Then how to calculate $a^2$ directly in mathematica? Is there any function turning binary into decimal? I only found its inverse...
1
vote
1answer
42 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: ...
0
votes
1answer
71 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 ...
2
votes
2answers
191 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 ...
1
vote
1answer
70 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
0
votes
1answer
57 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 ...
2
votes
1answer
49 views

A question about expanding complex functions of real arguments

I have the following problem. There is such an expression as: P[x_,y_] := z[y] E^(I beta x) + Conjugate[z[y] E^(I beta x)]; The variables ...
0
votes
1answer
56 views

Unexpected behavior of subtraction with approximate numbers [duplicate]

I'm using the Table command to generate a list of values: FullForm /@ Table[10. - x, {x, 2.7, 2.8, .1}] and I get the ...
4
votes
2answers
186 views

Floating point addition not associative

Can anybody explain the following behavior? x = 0.2 + (0.3 + 0.1); y = (0.2 + 0.3) + 0.1; x == y (* -> True *) But actually the variables do not exactly ...
80
votes
1answer
1k views

Why are numeric division and subtraction not handled better in Mathematica?

There is something that has been troubling me for a while. At least through version 10.0 the performance of a / b and a - b is ...
23
votes
1answer
564 views

Is there a difference between Divide[a,b] and a/b?

In this comment it was asserted that Divide[a,b] and a/b are different, though the documentation indicates that they are the ...
2
votes
1answer
257 views

Expressing large numbers in index form

I have a quick question. Is there anyway of expressing a large number as a power of another number in Mathematica? By this, I mean for example, $1237940039285380274899124224 = 512^{10}$. Is there a ...
2
votes
6answers
274 views

Is there any function that creates an array from 1 to n, repeating each value m times?

I am trying to implement SparseArray, using the function With to give the condition for different matrix elements. I would need ...
1
vote
1answer
248 views

Why is arithmetic faster for inexact arithmetic?

I have been trying to compute eigenvalues of a rather sizable matrix A, about $500 \times 500$ (but sparse). I asked Mathematica to compute ...
7
votes
2answers
206 views

Is there a way to show the details of a numerical computation?

I have recently started using Mathematica as a calculator while teaching (definitely overkill, but I try to use as few tools as possible). I would like my students to be able to trace simple numerical ...
0
votes
0answers
169 views

Rounding values [duplicate]

In Mathematica 8 when I enter 1 - 0.99 - 0.01 I get 8.67362*10^-18 instead of zero. How do I fix this problem? I am getting ...
26
votes
2answers
561 views

Should 0 * 5ft be 0 or 0ft?

After playing with the new quantity system in Mathematica 9 for a while, I keep stumbling over this issue: 0 * Quantity[1, "Meters"] is not the same as ...
1
vote
0answers
90 views

Non Commutative Multiply [duplicate]

Possible Duplicate: Non-commutative symbolic linear algebra I want to multiply two matrices, for example, A = {{e, f}, {g, h}} B = {{a, b}, {c, d}} ...
5
votes
1answer
223 views

Why can't I remove Orderless from Plus?

I am making some random algebra equations, and I want to have the ordering be random too, such that if my random equation generator makes x+1, the output stays ...
5
votes
14answers
2k views

Sum of Squares without multiplication

I want to sum the squares for a given number N from 1 without using Multiplication. Is it possible?
9
votes
3answers
5k views

Expressing a decimal as a fraction in lowest terms

How can I express a decimal such as 0.1845095405274387 as a fraction in its lowest terms?