If a for loop "iterates" a double from 0.00 to 0.40, for example, even when writing &lt;=, the loop terminates when i=39. When performing essentially the same thing using integers, the program acts normally.  #include &lt;iostream&gt; using namespace std;  int main() {     for (double i = 0.00; i &lt;= 0.40; i += 0.01) {         cout &lt;&lt; i &lt;&lt; " ";     }     return 0; }   This returns 1 2 3 ... 37 38 39.  You can test this here:   What causes this behavior and is there an ideal way to fix this, as just writing i &lt;= 0.41 seems like a hacky solution. Even more so if the 0.40 was a user entered value, adding a small quantity certainly be considered bad practice.  Sorry if the title and question are poorly phrases, I'm not sure how to word this.
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
Ubuntu 16.04.1 has appeared as .rar file. How do I burn it to a disk to use to install Ubuntu? I am interested in using Ubuntu for the fist time, so I went to the Ubuntu download page (), to get the download file. When the file downloaded he file, it appeared in WinRAR, so I cannot burn the file to a DVD. Can anybody point me in the right direction as to how to burn this file to a DVD when the file appears as a WinRAR file? Any help would be great appreciated. Thanks :) DataTable merge without primary key column Insert image from Google Drive into Google Sheets How do I insert/link to images existing in a folder in Google Drive into a Google Sheets spreadsheet?  There is the image() function, I imagine using it something like this:  image("googledrive://somefodleringoogledrivewithmypics/pic_1.png")   How?  Update: Some people noted that by uploading pictures to Picasa, we can then get the URL of each picture and use that. It works. The downside of this is that we have to copy each and every URL of all images. I put that in a separate sheet, then use VLOOKUP to get each image URL per index. It works but the URL copying part is a hell of a job if you have lots of images of course. A better solution is needed. If $\sum_{n=1}^{\infty} a_n^{2}$ converges, then so does $\sum_{n=1}^{\infty} \frac {a_n}{n}$ Let $a_1,a_2,a_3,\ldots$ be reals. Prove that if $\sum_{n=1}^{\infty} a_n^{2}$ converges, then so does $\sum_{n=1}^{\infty} \frac {a_n}{n}$.   For this I have shown the case for when $ a_n^{2} \le\frac {|a_n|}{n}$ $\Rightarrow$ $ |a_n|\le\frac {1}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le \frac{1}{n^{2}}$ and we know that $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges and hence $\sum_{n=1}^{\infty}\frac {a_n}{n}$ converges by the comparison test. Now considering $ a_n^{2} \ge\frac {|a_n|}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le a_n^{2}$ $\rightarrow$ combining the two cases for any n we have: $\frac {|a_n|}{n}\le\frac{1}{n^{2}}+a_n^{2}$ Hence using the comparion test again we know that $\sum_{n=1}^{\infty} a_n^{2}$ converges and $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges hence the sum converges so we can conclude that $\sum_{n=1}^{\infty} \frac {a_n}{n}$ is absoluetly convergent $\Rightarrow$ convergent.  Not to sure if this is correct, any help would be much appreciated, many thanks. Schwarz's Lemma and functions with positive real part Problem:     Let $D = \{ z \in \mathbb C : |z| &lt; 1 \}$. Suppose $f : D \to \mathbb C$ is a non-constant analytic function such that $\mathrm{Re} f(z) \geq 0$ for all $z \in D$.      (a) Show that $\mathrm{Re} f(z) \neq 0$ for all $z \in D$.      (b) Using a Möbius transformation and Schwarz's lemma, prove that if   $f(0) = 1$, then $$ |f(z)| \leq {1+|z| \over 1-|z|}. $$   What can be said if $f(0) \neq 1$?      (c) Show that if $f(0) = 1$, then $f$ also satisfies $$ |f(z)| \geq {1-|z| \over 1+|z|}. $$   Progress:  (a) We can use the open mapping theorem.  (b) We can compose a Möbius transformation $m$ that sends the right-half plane to $D$ with $f$. Then $h = m \circ f$ satisfies the hypotheses of Schwarz's lemma by construction. Simple manipulations of the inequality from Schwarz's lemma give the result.  (c) Looking at part (a), we know that $\mathrm{Re} f(z) \neq 0$, and so $f(z) \neq 0$. Thus, we can use the function $g = 1/f$ in the statement of part (b).  Question:  What about when $f(0) \neq 1$? I don't think you can get anything from $f(z)-f(0)+1$ unless $\mathrm{Re} f(0) &lt; 1$. And you can't in general rearrange the inputs of $f$ because $1$ isn't necessarily in the image of $f$. Also, I don't think you can get anything from $f(z)/f(0)$ unless $f(0)$ is real, because otherwise the range of $f(z)/f(0)$ could extend into the left-half plane. How can I make schematic of this board? Convert .mov to .mp4 I want to convert .mov to .mp4! I saved the video from iMovie but it is in .mov format! How do I convert it to .mp4?  I'm using a MacBook and I want to share it to my phone, but my phone can't open .mov format video. I mean, why is $F=ma$? Why not $m^{0.123}$, $a^{1.43}$ or some random non-integers or irrational?  I hope you understand that my question isn't limited just to force, energy, velocity, etc.; it also extends to the area of a square, circle, etc. and all other formulas.  I think the whole thing starts with direct proportionality.  Most of them tell about the area of a circle, $A = πr^2$, where π is 3.14159..... an irrational number! It's not about the constant. I am talking about the power of a physical quantity.  I know why it has pi. It's because we chose the constant for area square to be one. If we chose it to be 1 for the circle then the area of a square will have a constant, 1/pi.   I've edited the question to 'rational exponents' since all are giving me examples of decimal non-integers. Fitting unbreakable large equation on one line in a twocolumn layout New global search doesn't like tags I'm using a PIN code to log on my computer. However, Num ⇩ is always turned off, even if on before shutting down my computer. This is quite annoying as I always have to retype my PIN.  I've tried the suggestions  (same as ). But with no result. If I don't enable num lock on log in screen and use the numbers above the normal keys, num lock turns on after log on. Then it's too late, unfortunately.  So, how can I make num lock enabled by default when logging in? Thanks.  Edit: While I still want to solve this, I've figured it is not such a big problem. I will need to press some key for the "enter PIN screen" to show, and using Num ⇩ works and enables num lock. But then, still annoying if the computer was only locked (with num lock on) and I turn it off, hehe. What is the difference between standard i386 download and the amd64 download of Ubuntu 11.04? I am currently running the i386 on an amd machine, would my system work better with the amd64 download instead? (my machine was running Windows 7 64bit, but I neglected to look at that prior to installing Ubuntu). How to install "vanilla" TeXLive on Debian or Ubuntu? Debian and Ubuntu have very good texlive packaging. But I'd like to use tlmgr to have a more fine-grained control about upgrades and which packages I want to be installed.   So how do I install "vanilla" TeXLive on Debian/Ubuntu?   Also how do I make dpkg aware that I have TeXLive installed? Example of a domain where all irreducibles are primes and that is not a GCD domain One has the following relations for a domain $R$:  $R$ GCD domain $\Rightarrow$ All irreducible elements are prime  $R$ PID $\Rightarrow$ $(R$ GCD domain $\land$ $R$ statisfies ACCP$)$  $R$ UFD $\Leftrightarrow$ $(R$ GCD domain $\land$ $R$ satisfies ACCP$)$  $R$ satisfies ACCP $\Rightarrow$ $(R$ UFD $\Leftrightarrow$ All irreducible elements are prime$)$  $R$ GCD domain $\Rightarrow$ $(R$ UFD $\Leftrightarrow$ $R$ atomic domain$)$  So what is the difference between a GCD domain and a domain where all irreducible elements are prime? What is the "weakest" predicate $P$ such that  $R$ GCD domain $\Leftrightarrow$ $($All irreducible elements are prime $\land$ $P(R))$ ? Bottom of tool shelf grayed out I have lost functionality in the tool shelf. When I click on a selector or something in the bottom part of the tool self that you can hide and unhide, nothing happens. I can see the options but when I click it doesn't work. See screenshot where it says "Add Cylinder". How to find out the terminal command of an application? I want to use some applications shown on the Unity Launcher in a terminal, but I need to know the appropriate command to run them. How can I achieve that? apt-get build-dep is unable to find a source package I have already followed  to disable middle mouse button paste on my Ubuntu 12.04.   Works like a charm.   Now I am trying to achieve the same on my Linux Mint 17. When I try to  sudo apt-get build-dep libgtk2.0-0   it gives me the following output:   Reading package lists... Done Building dependency tree        Reading state information... Done Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0   For me it looks like apt-get is somehow "resolving" 'libgtk2.0-0' to 'gtk+2.0', but then does not find any package named like that.   EDIT:  although I am now able to compile the program (see my answer), I still do not know what  Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' is supposed to mean. Any insight on this would be appreciated, thanks! I recently learned that I have developed a consistent, but entirely wrong approach to punctuating direct speech in fiction. I am in the unenviable position of trying to relearn.  Previously I wrote such things as:     "I'm done." She said.   when the quoted speech was definitely, absolutely the end of a sentence. So now I know I need.     "I'm done," she said.   This follows the rule that a period is only allowed when the end of the spoken sentence is also the end of the sentence in the narrative. For example:     "I'm done." She slammed the door on the way out.   So, it now looks odd to me when there are multiple sentences in the speech:     "I can't take her. I'm done," she said.   Can you reassure me that is correct, or give the correct form? Please don't suggest rewriting the sentence to put 'she said' in the middle - I'm aware of that: I'm specifically asking about the punctuation rules.  The other odd case is speech ending with an ellipsis. Do sentence terminating ellipses (four periods normally) become:     "I can't take her. You know, ...," she said, nodding towards Jane.   If so, are non-terminating ellipses dealt with the same way?     "I can't take ...," she nodded towards Jane, "any more!"   or can non-terminating ellipses be used unadorned?     "I can't take ..." she nodded towards Jane, "any more!"   I'd be very grateful if you could point me at references as well as answers. For the record I am a British writer writing for both British and US publication, so any variation is also interesting to me! Question about Subrings and integraly closed How well-known is the theology of Middle-earth, in Middle-earth? One thing that is notably absent in Middle-earth is any mention of temples, churches, priests or religious rites.  There are passing mentions of Men who would "worship" Sauron, but generally the world of Middle-earth seems much less religious than medieval Europe, or even classical antiquity.  One never hears about "the cult of Aule" or "the cult of Yavanna," although historically there were many "cults of Athena" or "cults of Poseidon."  Aragorn doesn't (to my memory) make an offering to Tulkas before battle, nor does he pray to Eru Ilúvatar for victory, and all the holidays and solemnities seem to commemorate historical figures, not religious ones.  This is especially strange in a world where there are still living witnesses, like Galadriel, to the actions of the Valar and other "divine" beings, and where there are still Maiar wandering around talking to people and putting on flashy firework shows.  Now, a lot of people talk about how Tolkien didn't want the Valar to be considered "gods," but at the same time he did use phrases like "the gods of old" numerous times.  Clearly, these beings would have qualified for worship in most cultures.  And even without the Valar being considered a true pantheon, there is still Eru, a closer analogue to the Christian God of Tolkien's beliefs, and we know the denizens of Middle-earth knew of him (Him?) because of the line "Eru, who in Arda is called Ilúvatar."  And yet, Ilúvatar seems not to be terribly important to anyone on a daily basis.  So my question is this: how familiar with the "theology" of Middle-earth were the citizens of Middle-earth?  Would the average merchant in Rohan know about the Valar and the Maiar and Iluvatar and the Music of the Ainur?  The average noble in Minas Tirith?  The younger Elves, like Legolas?  The Dwarf Lords?  Were the theological truths about the formation of the world, the Valar and the Maiar just so well known that they weren't worth commenting on, or had they been forgotten by most?  And if they had been forgotten, why wasn't the knowledge (whether through deliberate teachings or casual conversation) re-invigorated by witnesses like Gandalf or Galadriel?