I want to calculate the lower limit bound for given price(2.65 * 0.9)   2.65 * (1 - 0.1) = 2.385  then round it to 2 decimal places, the result 2.385 -&gt; 2.39   round(2.385) = 2.39  but when I use C++ to implement above: double pclose = 2.65; double range = 0.1; double lmtdown = pclose * (1 - range); double lmtdownAfterRound= std::round( lmtdown * 100 ) / 100;  printf(&quot;pclose=%.2f, range=%.2f, limit down before round=%f,\n&quot;, pclose, range, lmtdown); printf(&quot;limit after round=%f\n&quot;, lmtdownAfterRound);  but the result printed is 2.38!!!!!! instead of 2.39 I wanted pclose=2.65, range=0.10, limit down before round=2.385000, limit after round=2.380000  I have tried anohter round method with std::floor: lmtdownAfterRound= std::floor(lmtdown * 100 + 0.5) / 100; printf(&quot;limit after round =%f\n&quot;, lmtdownAfterRound);  the result is still 2.38: limit after round with floor=2.380000  is there something wrong in my c++ code, How can I get the correct round value?
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
VirtualBox 5.0.40 crashes the whole host since update to kernel 4.13.0-26-generic I received the updates through normal Software Updater, 10-Jan-2018. After this VirtualBox would not start any VM, complaining about dkms and asking to make modprobe vboxdrv. Following the advice I reinstalled virtualbox-dkms with:  sudo apt-get --reinstall install virtualbox-dkms   After this and a reboot I tried to start a VM which freezed the whole machine and a hard reboot was necessary.  Is there a way to make VirtualBox work with the latest kernels?  EDIT:  As suggested by N0rbert, the command:  apt-cache policy `dpkg -S VirtualBox | head -n1 | sed -e 's/://g' | awk '{print $1}'`  gives:   virtualbox-qt:   Installed: 5.0.40-dfsg-0ubuntu1.16.04.2   Candidate: 5.0.40-dfsg-0ubuntu1.16.04.2   Version table:  *** 5.0.40-dfsg-0ubuntu1.16.04.2 500         500 http://fr.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages         100 /var/lib/dpkg/status      5.0.18-dfsg-2build1 500         500 http://fr.archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages   EDIT (on 29-Mar-2018): Issue is resolved for me, with the Ubuntu Ubdate from today. I have seen that it had some virtualbox-updates, therefore I tried to boot with the most recent kernel again. Then I had to run  sudo apt-get --reinstall install virtualbox-dkms  And after this my virtual machines in VirtualBox started working without crashing the whole computer. Finally! All Stack Exchange data dumps Pandemic, Global Epidemic, Epidemic, Endemic I really want to hear from the experts the definitions of all 4 terms especially whether global epidemic is equivalent to pandemic. Or should this question be directed to the epidemiologist?   Pandemic Global Epidemic Epidemic Endemic   I have Googled the terms and I understand the definition of 1), 3) and 4). In short the definition is based on geographical location and scale of outbreak, Pandemic is an outbreak of disease on a global scale (e.g. HIV). Epidemic is an outbreak of disease on a localised area. Endemic is a disease in a localised area. However, a definition for Global Epidemic is not available online.  Recently, WHO mentioned that "“It is important to put this on the table: this virus(Covid19) may become just another endemic virus in our communities, and this virus may never go away,” WHO emergencies expert Mike Ryan told an online briefing." Isn't covid19 considered a pandemic since it is on a global scale and is spreading rapidly?  Another term that I come across often is Global Epidemic. For example in the WHO website, HIV is listed as Global Epidemic. Does that mean Pandemic and Global Epidemic are the same? How does Lockable Suspension work? I recently asked a question about . There  told me about the “blow off” feature. Now, I am curious about how the whole system works.   So, can anyone tell me about how a lockable front suspension works, together with features like “remote-lock” and “blow-off”. 'I have decided to purchase a jet for getting to NYC and back more quickly.' Are the following sentences grammatical or not? If not, does substituting a to-infinite make them grammatical? (Optional: designate if the sentence expresses purpose, reason, aim, or function)  1 I have decided to purchase a jet for getting to NYC and back more quickly. 2 I have decided to buy a jet for having a quicker way to get to NYC and back.  This is my only reason and aim; this will be the jet's only purpose and function.  3 I hate hairdryers, so I am buying a space heater for drying my hair more naturally, and that is my only aim &amp; purpose &amp; reason and that will be its only function 4 For having a lasting shine in your hair, buy ShineOn Shampoo. 5 My neighbor and I have decided to cooperate more for having a better life together.   Research done: ELL  (Note the  here is a restatement of Cambridge Dictionary's ) ELL  ELL  BBC English  (Currently the best site I've found.) ELU  All of which have answers that I find  (i) incomplete (ii) contradictory (iii) terribly confusing, if not (iv) wrong. To sort through the haze, I am focusing on one issue. Background Some sources say that you need to use a to-infinitive for expressing purpose, aim, function, reason, etc. I find these to be rather hazy distinctions, given that the ODO defines  as The reason for which something is done or created or for which something exists and the same work lists as : aim, reason, function, etc. It is my assertion that at least some of the following sentences demonstrate that one can use the -ing form (be it a gerund, verbal noun, participle) to express individual purpose (aim, reason, function, intention, whatever you want to call it). Do you agree, or not? Why (not)?  In shorter terms, are the sentences grammatical? or do we have to substitute a to-infinitive (including in order to + infinitive) to make them grammatical? (Optional: designate if the sentence expresses purpose, reason, aim, function, etc.) Is it possible to prove a null hypothesis? How to factor numbers that are the product of two primes Problem with pstricks and htlatex/tex4ht Consider the following MWE:  \documentclass{article} \usepackage{pst-all}  \begin{document}   \begin{pspicture}(0,-3)(12,5)       \psline[linewidth=2pt]{-&gt;}(1.5,0)(0,0)   \end{pspicture} \end{document}   This compiles fine with latex (not with pdflatex) but when run with htlatex it leads to the ghostscript error:  System call: dvips -E -q -Ppdf -f q.idv -pp 2 &gt; zzq.ps System return: 0 System call: gs -sDEVICE=pngalpha -sOutputFile=q0x.png -r110x110 -dEPSCrop -dBackgroundColor=16#ffffff -dTextAlphaBits=2 -dGraphicsAlphaBits=2 -q -dbatch -dNOPAUSE zzq.ps -c quit Error: /configurationerror in --setpagedevice-- Additional information: [/PageSize [0 0]] Operand stack:    --nostringval--   (%%BoundingBox: 72 72 72 72)   --dict:1/2(ro)(G)--   --nostringval--   --nostringval--   (%%BoundingBox: 72 72 72 72)   1   72   72   false   --dict:1/1(L)-- Execution stack:    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1951   1   3   %oparray_pop   1950   1   3   %oparray_pop   --nostringval--   1934   1   3   %oparray_pop   1820   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   %ztokenexec_continue   (scanner state)   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   1913   10   3   %oparray_pop   --nostringval--   --nostringval--   --dict:1/10(L)--   --nostringval--   15   %dict_continue Dictionary stack:    --dict:1190/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)-- Current allocation mode is local Last OS error: Invalid argument Current file position is 169 GPL Ghostscript 9.16: Unrecoverable error, exit code 1 --- Warning --- System return: 256 Entering q.css Entering q.tmp   This code used to work fine. From other examples I suspect that the problem has something to do with dvips having trouble determining the bounding box for the image (compare with  -- although the solution given here, of using separate files for each image, is not a viable solution for me), but I have not been able to work out what the problem is.  Does anyone have any ideas? Get file size before uploading Let $a=p_1^{x_1}p_2^{x_2}\cdots\cdot p_q^{x_q}$ and $b=p_1^{y_1}p_2^{y_2}\cdots p_r^{x_r}$ ,   say — Since gcd(a,b) is the largest common divisor of a and b and is divisible by any other common divisor of the two,   GCD$(a,b)=p_1^{\min(x_1,y_1)}p_2^{\min (x_2,y_2)} \cdots p_q^{\min (x_q,y_q)}$  LCM$(a,b)= p_1^{\max(x_1,y_1)}p_2^{\max(x_2,y_2)}\cdots p_r^{\max (x_r,y_r)}$  I understand GCD(a,b) has to divide both $a,b$. Therefore the exponent of any prime factor $p_i$ in GCD has to be in both $a,b$  — therefore $p_i^{\min(x_i, y_i)}$. But I'm muddled and anxious. Why does $\min$ appear in GREATEST common divisor? Why does $\max$ appear in LOWEST common multiple? The plot is simply that aliens visit Earth and their interest in collecting cow pies (and just like other collectibles, special attributes make them more valuable) creates interest in humans in obtaining them to sell. Then the aliens leave and the market plummets. I do not recall the name of the story and also at the end I think some new object is of interest which maybe someone remembers. As silly as the premise sounds, if you look at what people really do collect and the amazing prices, the story kind of resonates. Digital crypto-kitties or whatever and more recent things selling for tens of millions or cryptocurrencies themselves seem not so different than cow pie collecting. Moreover, the fundamental theorem of collectibles is that to make a huge amount, paradoxically the collectible had to not only start out as more or less worthless but also something people tended to use/read and then destroy or at least throw away. Old Nat Geo magazines are worth almost nothing because everyone kept them; Action Comics #1 on the other hand, well moms could not wait to toss those when their son went away to college or got married. The stories I have in just my own family. How to read a file without newlines? I can't run this latex script Generate all combinations from multiple lists I've followed this tutorial to install Ubuntu 15.10:    After restarting my computer I got to the grub menu and chose Ubuntu. Shortly after that I got this error:  /run/lvm/lvmetad.socket: connect failed: No such file or directory WARNING: Failed to connect to lvmetad. Falling back to internal scanning.   These messages keep adding up on a black screen every second. After a while,  I get access to the initramfs ash console.  what am I doing wrong? Running out of cards in Exploding Kittens In the Exploding Kittens game, the rules say     You won't ever run out of cards in the Draw Pile, so there is never any need for a reshuffle.   In every game I've played all the cards end up on the discard pile fairly quickly and there is nothing left in the draw pile, so we have to reuse them.  Is this meant to happen? Are we doing something wrong? Is the wave-particle duality a real duality? How to compute $\lim_{n\rightarrow\infty}e^{-n}\left(1+n+\frac{n^2}{2!}\cdots+\frac{n^n}{n!}\right)$ There is a probabilistic method to solve it. But I am not familiar with probability. I am trying to compute it by analytic method, such as using L Hospital's rule or Stolz formula, but they are not working. Why do you need to change your position rather than just focal length to affect perspective? Why must you change your distance from an object to change your perspective of it? Why is it not sufficient to change the focal length of your lens (the zoom level) to change  your perspective? Black artifacts when looking through many transparent objects?