This code isn't working as I thought it would.  a=-1;    b=0.1;    for(i=0;i&lt;=20;i++){       System.out.println(i + ". x= " + a);        a=a+b;    }          On the console I should see:  0. x= -1.0   1. x= -0.9   2. x= -0.8   3. x= -0.7   4. x= -0.6   5. x= -0.5   6. x= -0.4   7. x= -0.3     ...etc    But this is what happens:  0. x= -1.0   1. x= -0.9   2. x= -0.8   3. x= -0.7000000000000001   4. x= -0.6000000000000001   5. x= -0.5000000000000001   6. x= -0.40000000000000013   7. x= -0.30000000000000016   8. x= -0.20000000000000015   9. x= -0.10000000000000014   10. x= -1.3877787807814457E-16   11. x= 0.09999999999999987   12. x= 0.19999999999999987   13. x= 0.2999999999999999   14. x= 0.3999999999999999   15. x= 0.4999999999999999   16. x= 0.5999999999999999   17. x= 0.6999999999999998   18. x= 0.7999999999999998   19. x= 0.8999999999999998   20. x= 0.9999999999999998     What am I doing wrong here?
In my program I have one array with 25 double values 0.04 When I try to sum these values in a loop I get following results:  0.0 + 0.04 = 0.04 0.04 + 0.04 = 0.08 0.08 + 0.04 = 0.12 0.12 + 0.04 = 0.16 0.16 + 0.04 = 0.2 0.2 + 0.04 = 0.24000000000000002 0.24000000000000002 + 0.04 = 0.28 0.28 + 0.04 = 0.32 0.32 + 0.04 = 0.36 0.36 + 0.04 = 0.39999999999999997 0.39999999999999997 + 0.04 = 0.43999999999999995 0.43999999999999995 + 0.04 = 0.4799999999999999 0.4799999999999999 + 0.04 = 0.5199999999999999 0.5199999999999999 + 0.04 = 0.5599999999999999 0.5599999999999999 + 0.04 = 0.6 0.6 + 0.04 = 0.64 0.64 + 0.04 = 0.68 0.68 + 0.04 = 0.7200000000000001 0.7200000000000001 + 0.04 = 0.7600000000000001 0.7600000000000001 + 0.04 = 0.8000000000000002 0.8000000000000002 + 0.04 = 0.8400000000000002 0.8400000000000002 + 0.04 = 0.8800000000000002 0.8800000000000002 + 0.04 = 0.9200000000000003 0.9200000000000003 + 0.04 = 0.9600000000000003   Why on earth could that happen?!
I've read a great article about the . But there are still some points that are unclear.  Why do we say...   school project but not school's project? car service but not car's service or even cars' service (plural form)? apostrophe usage but not apostrophe's usage or apostrophes' usage? Redirect 301 with hash part (anchor) # text-overflow: ellipsis in table-cell without width Compute integral $\int_{-\infty}^\infty \frac{x^4}{1+x^8} \, dx$ Compute the integral.   $$\int_{-\infty}^\infty \frac{x^4}{1+x^8} \, dx$$  The answer at the back of the book is  $$\frac{\pi}{4\sin(\frac{3\pi}{8})}$$ How can I access the "Open command window here" option in Windows without holding shift? Don't heavier objects actually fall faster because they exert their own gravity? The common understanding is that, setting air resistance aside, all objects dropped to Earth fall at the same rate. This is often demonstrated through the thought experiment of cutting a large object in half. The halves clearly can't then fall more slowly just by being sliced in two.  However, I believe the answer is that when two objects fall together, attached or not, they do "fall" faster than an object of less mass alone does. This is because not only does the Earth accelerate the objects toward itself but the objects also accelerate the Earth toward themselves. Considering the formula: $$ F_{\text{g}} = \frac{G m_1 m_2}{d^2} $$  Given $F = ma$ thus $a = F/m$, we note that the mass of the small object doesn't seem to matter as when calculating acceleration the force is divided by the $m$ term, its mass. However, this overlooks that the force is actually applied to both objects, not just to the smaller one. The acceleration on the second, larger object is found by dividing $F$, in turn, by the larger object's mass. The two objects' acceleration vectors are exactly opposite, so closing acceleration is the sum of the two:  $$ a_{\text{closing}} = \frac{F}{m_1} + \frac{F}{m_2} $$  Since the Earth is extremely massive compared to everyday objects, the acceleration imparted on the object by the Earth will radically dominate the equation. As the Earth is $\sim 5.972 \times {10}^{24} \, \mathrm{kg} ,$ a falling object of $5.972 \, \mathrm{kg}$ (just over 13 pounds) would accelerate the Earth about $\frac{1}{{10}^{24}}$ as much, which is one part in a trillion trillion.  Of course in everyday situations, we can for all practical purposes treat objects as falling at the same rate because of this negligible difference—which our instruments probably couldn't even detect. But I'm hoping not for a discussion of practicality or what's measurable or observable, but what we think is actually happening.  Am I right or wrong?  What really clinched this for me was considering dropping a small Moon-massed object close to the Earth and a small Earth-massed object close to the Moon. This made me realize that falling isn't one object moving toward some fixed frame of reference, but that the Earth is just another object, and thus "falling" consists of multiple objects mutually attracting in space. Why did Voldemort stop employing Occlumency against Harry in Deathly Hallows? Why is there a difference between ping "localhost" and ping "local IP address"? Using cmd and ping on Windows gave me the following results:   Pinging "localhost":       Pinging "192.168.0.10" (local IP address):     Aren't both situations exactly the same?   I mean, I'm pinging the same interface, the same machine and the same address. Why do I get such different results?  EDIT: Here is my ipconfig /all screen: Is there a preferred way to return multiple values from a C++ function?  For example, imagine a function that divides two integers and returns both the quotient and the remainder.  One way I commonly see is to use reference parameters:  void divide(int dividend, int divisor, int&amp; quotient, int&amp; remainder);   A variation is to return one value and pass the other through a reference parameter:  int divide(int dividend, int divisor, int&amp; remainder);   Another way would be to declare a struct to contain all of the results and return that:  struct divide_result {     int quotient;     int remainder; };  divide_result divide(int dividend, int divisor);   Is one of these ways generally preferred, or are there other suggestions?  Edit: In the real-world code, there may be more than two results.  They may also be of different types. I'm adding a title clock in the foot line of a beamer slide, if I compile it with pdfLaTeX it works fine; while the clock doesn't align in the middle vertically if compiling with XeLaTeX. How can I fix this.  Here is my MWE:  \documentclass[10pt]{beamer} \usepackage[font=Times,timeinterval=1]{tdclock} \usetheme{Madrid} \title{Title} \author{Authors} \institute{Institute} \date[\initclock\tddate\ \ \tdtime]{\today} \begin{document} \frame{\titlepage} \end{document} Different colors for different types of blocks in beamer Minimum safe spacing between lava and flamable materials? It seems that containing lava in solid glass, stone and iron blocks may not be sufficient to prevent wool from burning, even if the lava is completely encased.         After some delay, it seems that fire will jump onto the wool above the iron.   Are solid blocks more effective than airspace, or not? If so, Does it matter whether the corner block is filled in? What are the exact rules on distance that I need, and how can I prevent flammable blocks from being eliminated by nearby lava? Bonus: Does a flowing lava block behave differently than a lava source block when it comes to fire creation? When the article the is used before theorem names When writing math papers, one sometimes has to refer to some famous theorems, for instance, the Pythagorean theorem.   Shall I write "by Pythagorean theorem", or "by the Pythagorean theorem". When shall I use the article "the"? How to turn the white colour portion to transparent I got this map icon in work in illustrator, and would like to turn those white dash line and the white outline of the location mark to transparent. Can you please advise me how to do it? Thank you in advance. How to calculate the Fourier transform of a Gaussian function? I would like to work out the Fourier transform of the Gaussian function   $$f(x) = \exp \left(-n^2(x-m)^2 \right)$$  It seems likely that I will need to use differentiation and the shift rule at some point, but I can't seem to get the calculation to work. Does anyone have any advice?  By the way, I am using   $$\mbox{FT}(f)(k)=\int_{-\infty}^\infty f(x)e^{-ikx}\,\mathrm d x$$  as my definition of a Fourier transform. Many thanks. Find $\lfloor {\alpha}^6 \rfloor$ If $\alpha$ is a real root of the equation   $$x^5-x^3+x-2=0$$   find the value of $\lfloor {\alpha}^6 \rfloor$.      This one totally stumped me. We are asked to calculate $\lfloor {\alpha}^6 \rfloor$ without actually calculating the root or using wolfram alpha or any other calculator. I found that the above equation has only one real root by sketching its graph using calculus. I was also able to use the intermediate value theorem to conclude that $1&lt;\alpha&lt;2$ , but this is of little use while calculating $\lfloor {\alpha}^6 \rfloor$. Please help! How do Natures work? In at least some Pokemon games there are modifiers called "Natures" which affect pokemon stats. What do they do and how do it work? Also, what specific games possess it? How does centrifugal force work? I know what centrifugal force is, but how does it work? Why are things forced to the outside? Class object affecting other class object when thread.sleep- Python Equation's symbols or parameters description are shown below, however, the = and the details of parameter are not aligned.     I want to make a parameters list for a equation like this, in which symbols, = and detail information are aligned in terms of vertical position.  where    ...    P   =   notional permeability factor    N   =   number of waves    Sd  =   damage level    ...   A tabular environment will produce more spacing before and after text. So how to make the = vertical aligned?   The codes is provided:  \begin{equation} \frac{H_s}{\Delta D_{n50} } = 1.0~ P^{0.13}~ \left(\frac{S_d}{N} \right)^{0.2} \xi_m^P~ \sqrt{\cot \alpha} \end{equation} where:   $H_s$ = significant wave height, equal to the average of the highest 1/3 of the waves  $\Delta$  = relative buoyant density, equal to $\rho_r / \rho_w - 1$, where     $\rho_w$ is the water density  $D_{n50}$ = nominal  diameter defined in Equation (2)  $P$ = notional permeability factor  $S_d$ = damage level   $N$ = number of waves  $\xi_m$ = breaker parameter based on mean wave period $T_m$  $\alpha$ = slope angle