Vba loop values not exact I don't understand why my simple loop in vba not working as I want. I would like to make a diagram and loop through the x axis values with a step = 0,01. I cut out part of the code, probably not necessary for this question. My problem is that the generated values are not exact. It should be something like: 0; 0,01; 0,02; ... and so on but around 0,82 the cell value is: 0,820000000000001 and after that the error goes on. This little bit of difference between 0,82 and 0,820000000000001 is not much but makes a lot of problem for me. For example: in the loop I can not use this: If x = 0.82 ...  because it is not going to be equal. I can cure this problem but there are others and maybe there  is a simpler solution. Here is the code: Sub Generate_Punch()   Dim NoL As Integer NoL = Worksheets(&quot;Punch&quot;).Range(&quot;D5&quot;).Value 'Number of loops  Dim d As Double d = Worksheets(&quot;Punch&quot;).Range(&quot;D4&quot;).Value 'value of increment/step   'which line start Dim i As Integer i = 15  'Coordinate values: Dim x, y As Double x = 0 y = 0   Worksheets(&quot;Punch&quot;).Range(&quot;A&quot; &amp; i &amp; &quot;:F32767&quot;).Clear  For j = 1 To NoL          'Counter     Worksheets(&quot;Punch&quot;).Cells(i, 1).Value = j          'X coordinate values:     Worksheets(&quot;Punch&quot;).Cells(i, 2).Value = x      '.... .... ....          i = i + 1     x = x + d Next j  End Sub  Thank you for your answers. Best regards, Robert
Is floating point math broken? Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
Can I use Stack Exchange logos on a t-shirt or other apparel? I happened to notice while on the Super User site that one user's picture shows him wearing a shirt with the Super User logo on it. Interested, I wanted to find out where he got it from. Looking through old questions on Meta, I found out that there used to be a shop.stackexchange.com site that sold Stack Exchange gear. Unfortunately, they no longer sell any merchandise.  Is there any site where I can purchase a Stack Exchange site shirt/hat/etc.? If not, could I create a shirt/hat/etc. myself with one of the sites' logos on it? If so, where can I locate the logos in their largest size? Suppose $\displaystyle P(x,y)$ a polynomial in the variables $x,y$.   For example, $\displaystyle x^4$ or $\displaystyle x^3y^2 + 3xy + 1$.  Is there a general method which allows us to evaluate the indefinite integral     $$ \int P(\sin x, \cos x) \text{d} x$$   What about the case when $\displaystyle P(x,y)$ is a rational function (i.e. a ratio of two polynomials)?   Example of a rational function: $\displaystyle \frac{x^2y + y^3}{x+y}$.    This is being asked in an effort to cut down on duplicates, see here:   and here: I was wondering what the max. length restrictions are for SharePoint Online Managed Metadata Service:  - TermGroup name  - TermSet name  - Term/Label name/value  I could not find anything on MSDN. A link to a source or reference would be fantastic, too. Why doesn't the Go statement execute in parallel? On the functional square root of $x^2+1$ There are some math quizzes like: find a function $\phi:\mathbb{R}\rightarrow\mathbb{R}$  such that $\phi(\phi(x)) = f(x) \equiv x^2 + 1.$  If such $\phi$ exists (it does in this example), $\phi$ can be viewed as a "square root" of $f$ in the sense of function composition because $\phi\circ\phi = f$.  Is there a general theory on the mathematical properties of this kind of square roots? (For instance, for what $f$ will a real analytic $\phi$ exist?) Directing Domain to Hosting Directory I just purchased a domain on Dreamhost, let's say foo.com. I already have hosting, let's say at 123.4.56.789, and have setup a directory foo.com which is accessible at 123.4.56.789/foo.com/. I can set the DNS to point foo.com to that IP, but how do I route it to that folder once it's there? My hosting has a really bad cPanel that gives me almost no help. Can I use .htaccess, or something else? What's the best way to accomplish this?  Edit in response to comment(s): It's VPS hosting, so I have access to http.conf and other system files. Also, yes it's Apache. Irreducible polynomials and affine variety Let $k$ be any field, and let $f,g\in k[x,y]$ be two irreducible polynomials such that $g$ is not divisible by $f$. Prove that $V(f,g)\subseteq A_k^2$ is finite. How do I view all available HDD's/partitions? Is there any reason to use this-> I am programming in C++ for many years, still I have doubt about one thing. In many places in other people code I see something like:  void Classx::memberfunction() {     this-&gt;doSomething(); }   If I need to import/use that code, I simply remove the this-> part, and I have never seen anything broken or having some side-effects.  void Classx::memberfunction() {     doSomething(); }   So, do you know of any reason to use such construct?  EDIT: Please note that I'm talking about member functions here, not variables. I understand it can be used when you want to make a distinction between a member variable and function parameter.  EDIT: apparent duplicate: Bounding lines around tax nodes I am trying to draw lines around a number of nodes. I very much like the definition of \convexpath definition given , but it is not working well on my setup (MacTex 2014 with all available updates).   I tried to compile , but what I get is the following, which is clearly not what I should be getting. Any ideas would be much appreciated. My internal storage capacity is running low,  what can I do? Currently, my internal storage is running low on space.    What can I do besides moving applications to the external memory, as to free up more space, but preserve my current applications and avoid uninstalling?  (Some of them won't be moved) I have parent folder "parent". Inside this folder I have subfolders, and a file named "names.txt". this file includes the names of these subfolders as follow:  Parent_folder folder1 folder2 folder3 folder4 . . . . names.txt   The content of the file "names.txt" is as follow:  folder1 folder2 folder3 folder4 . . .   Inside every folder I have images and I want to apply consecutively 10 scripts on every image ( every script must finish it is job inside every folder, then the second script must be run). These scripts have different names and they are exist in one folder. I set an environment by sourcing a file then I can call these scripts by its name from terminal .At the same time I want to apply this process on all the folders at once. i.e. when script #1 is running, I want it to be running on all the folders at the same time. When it is done and script #2 will start. I want it to start in all the folders at once and so on... In order to achieve this I wrote the following code:  #!/bin/bash path=PATH/TO/THE/PARENT/FOLDER for i in $(cat $path/names.txt); do { script#1 } &amp; { script#2 } &amp; . . .  done   This code is not working efficiently as all the commands are running at once. I want the commands to run on all the folders at once but consecutively.  What I am doing wrong? Why is the sky dark at night? The question is the well-known      If there are so many/infinite stars, in every direction, why is it dark at night? Where goes all the light we don't see?    Discussing with a friend we found different answers.   The first (my friend's answer) is that given the fact that in a finite amount of time (in this case, the age of the universe), light can travel only a certain, finite, distance, we cannot see, if they actually exist, stars farther than such distance (about 13 billions of years, I guess). Then he states (or better, I got him notice he implicitly does this)  that within this radius there aren't enough stars to fill the night sky, and that's why we have darkness without sun's light.   The second answer (mine, or anyway the one I heard from a minutephysics YouTube video) is that despite of the big size of the observable universe, cosmological expansion red shifts most of the light out of the visible radiation range, so that the majority of light can't be seen by our eyes at night, while if we use, for example, an infrared camera, we should see a brighter sky, and lenghtening more and more the wavelength at which we observe the sky, we come to the uniform background radiation.  So my question is, what is the right answer? Is it one of the above-mentioned or even a third one?  EDIT: I've seen both answer may be acceptable, but what is the main contributing phenomenon? Prove that $\lfloor\lfloor x/2 \rfloor / 2 \rfloor = \lfloor x/4 \rfloor$ How many attacks can a fighter with two-weapon fighting make at 5th level? Boolean variable returns as string from javascript function How to find (and delete) duplicate files I have a largish music collection and there are some duplicates in there. Is there any way to find duplicate files. At a minimum by doing a hash and seeing if two files have the same hash.  Bonus points for also finding files with the same name apart from the extension - I think I have some songs with both mp3 and ogg format versions.  I'm happy using the command line if that is the easiest way. In the Landau theory of phase transitions, is the order parameter a thermodynamic variable of state? In the Landau theory of phase transitions, one typically considers a "free energy" $F$ as a function of the temperature $T$ and the "order parameter" $\psi$: $F(T, \psi)$.  For the sake of clarity, let's consider the liquid-gas transition, in which the order parameter is usually taken to be the difference of densities between the ordered phase and the disordered phase.  In this case, it looks that the order parameter $\psi$ is closely related to the the volume $V$, a global variable of state.  What is the correct interpretation of $\psi$ as a thermodynamic variable?   I consider several logical possibilities, but all interpretations look troublesome to me:    $\psi$ is a variable of state replacing the volume. In this case I have a few related concerns:   Is the "free energy" $F$ the Helmholtz or the Gibbs free energy?    If $F$ is the Gibbs free energy, $F$ should depend on the temperature $T$ and the pressure $p$ (the conjugate variable of the volume), so it shouldn't depend on $\psi$.  If it is the Helmholtz free energy, it's ok that it depends on $\psi$, but the experiments are usually carried out at constant pressure, not constant volume.  Usually, state variables are something one can select at will [for instance, think of the phase diagram $(p, T)$]. However, the order parameter $\psi$ is not selected at will, but it is selected by the system as a result of the minimization process according to the Landau theory.  $\psi$ is yet another variable of state in addition to volume and temperature.    Why the pressure is not usually taken into account as a variable of state, and only the temperature is considered? What is the conjugate variable to $\psi$? Can really $\psi$ and $V$ be taken as independent?  $\psi$ is not a variable of state, is something else.   What else can $\psi$ be from the thermodynamic point of view? Same question as above, why is pressure not usually taken into account in Landau theory? On , there are download options for only certain logos/icons. Shouldn't this include all the graduated sites logos/icons? I think it should. Passing parameters to a document I compile most of my documents via Makefiles which take care of the bibliography, indexes, etc. Often I'd like to compile different versions from the same TeX file changing only small things (e.g. a beamer presentation plus a version with the handout option).  Is there any standard mechanism for passing parameters to the TeX file so that I can just type make handout to get the handout version in the above example?