All code in my contributions on Mathematica.SE, unless otherwise specified, is dual-licensed under CC-by-SA 3.0 and your choice of any one of the following:
|
1m
|
|
comment |
Help understanding overloading of Atomics within Block As one might expect, this general technique also doesn't work if the head Complex exists only by implication, as in a packed array.
|
|
3h
|
|
revised |
Using Goto and Label in compiled function? edited tags |
|
4h
|
|
comment |
Restrictions on CoprimeQ[n_1, n_2] Using the 41st and 42nd Mersenne primes, I tested it up to 7.5 million decimal digits. It took 20 seconds, which seems not unreasonable. If you have longer to wait, I suppose you can do a hundred million digits with no problem. |
|
5h
|
|
comment |
Compile: Putting integers into a list @SimonWoods I think that's worth making into an answer, both because this hasn't got an answer yet, and also because it's sufficiently obscure that people may not be inclined to think of it. |
|
9h
|
|
comment |
Granular off-topic close reasons @rm-rf that's fine from SE's perspective, since as an American company running English language websites, they are quite well protected from copyright suits, either in law or in effect. But SE can't and won't protect any of us from being sued as individuals in e.g. France if we decide to do something for which French copyright law doesn't grant permission on the basis that it would have been acceptable in America. I suppose this is arguably the individual's problem and as such we don't have to consider it in how the site is run, but individuals should look out for their own interests as well. |
|
10h
|
|
comment |
Granular off-topic close reasons @rm-rf when thinking about "fair use", we should take care to remind ourselves that many jurisdictions do not have such exemptions, or have them in a much weaker form than the USA. Given our global reach, I think the focus should be on avoiding anything likely to be seen as problematic, rather than permitting by default whatever is allowable under US law. |
|
10h
|
|
comment |
Restrictions on CoprimeQ[n_1, n_2] Well, I suppose it's not quite right to say there is no in-principle limitation, since the maximum number Mathematica (version 9) can deal with has about 20.7 billion decimal digits. In practice I think you will run into memory or computational efficiency limitations before then. |
|
10h
|
|
comment |
Restrictions on CoprimeQ[n_1, n_2] If p and q are in fact both prime (or at least coprime), calculating EulerPhi[m] is best done as (p - 1)(q - 1), since EulerPhi takes a long time for prime products. I tried CoprimeQ[(p - 1)(q - 1), e] with p, q, and e all ~6400-bit numbers (i.e. more or less your "large integer" to the hundredth power) and found it to take no noticeable time. Generating large primes takes a while so I didn't try a bigger example than this, but if you have p and q already, I suppose you can do numbers at least a few tens of thousands of digits in length without a problem.
|
|
11h
|
|
comment |
Why wolframalpha.com can be more powerful than Mathematica sometimes? @MarkMcClure it's always seemed to me that Alpha would rather give an answer that was probably correct than not give one because it couldn't prove it. W|A seems to be getting better than it used to be, so maybe what I had observed previously were just bugs. Mathematical examples of this behavior now seem thankfully rare, although asking about e.g. thermophysical behavior of materials will still often get you an absurd extrapolation from marginally relevant literature data. And, of course, no reference is given to that literature, so the result is worthless. |
|
11h
|
|
revised |
How to embed an image into a string? edited tags |
|
11h
|
|
comment |
How to embed an image into a string? I think this is quite clearly a malformed box expression, so I'm going to go ahead and tag this question with [tag:bugs]. |
|
11h
|
|
comment |
Granular off-topic close reasons @rm-rf that's fine--I suppose we don't need the reasons to be extremely specific, and the documentation is anyway by far the most commonly referenced external canonical source. My main reason for suggesting this in these terms was to avoid copyright infringement, which can be the result of repeating something from elsewhere without adapting it in any way. Since it doesn't look like people like the reason, we'll have to be careful of that pitfall when choosing to answer questions of this sort. |
|
11h
|
|
reviewed | No Action Needed How could I define a function as the solution of equations in Mathematica? |
|
11h
|
|
comment |
Granular off-topic close reasons @SjoerdC.deVries of course I am not suggesting by proposing this reason that just because a question technically meeting these critera could be closed, it necessarily should be. I think the reason needs to exist for those cases where the question is clearly inappropriate, since there is no good alternative otherwise. Naturally we also need people to apply it judiciously, but I don't think this should be a problem given current closing trends. |
|
11h
|
|
comment |
Granular off-topic close reasons @0x4A4D I think this is overkill, myself, but if you think it'll help--sure, go ahead. |
|
11h
|
|
comment |
Restrictions on CoprimeQ[n_1, n_2] I think there is probably no in-principle limitation, but it is going to be pretty slow by the time you start considering numbers with hundreds of millions of digits, which may represent a significant difficulty in practice. What, exactly, do you mean by "much greater than"? |
|
2d
|
|
reviewed | Close How to evaluate only arguments, but leave topmost expression unevaluated? |
|
Jun
16 |
|
comment |
Why wolframalpha.com can be more powerful than Mathematica sometimes? W|A cares less about the validity of the answer than Mathematica does, so heuristic approaches are sometimes applied and reported as if the result is a certainty. Be careful how you use its output. |
|
Jun
16 |
|
reviewed | Leave Open Unresolved differential equation |
|
Jun
16 |
|
revised |
Unresolved differential equation added 6 characters in body; edited tags |