Why do I get platform-specific result for std::exp? I have a program that were giving slithly different results under Android and Windows. As I validate the output data against a binary file containign expected result, the difference, even if very small (rounding issue) is annoying and I must find a way to fix it.  Here is a sample program:  #include &lt;iostream&gt; #include &lt;iomanip&gt; #include &lt;bitset&gt;  int main( int argc, char* argv[] ) {     // this value was identified as producing different result when used as parameter to std::exp function     unsigned char val[] = {158, 141, 250, 206, 70, 125, 31, 192};      double var = *((double*)val);      std::cout &lt;&lt; std::setprecision(30);      std::cout &lt;&lt; "var is " &lt;&lt; var &lt;&lt; std::endl;     double exp_var = std::exp(var);     std::cout &lt;&lt; "std::exp(var) is " &lt;&lt; exp_var &lt;&lt; std::endl; }   Under Windows, compiled with Visual 2015, I get the output:  var is -7.87234042553191493141184764681 std::exp(var) is 0.00038114128472300899284561093161   Under Android/armv7, compiled with g++ NDK r11b, I get the output:  var is -7.87234042553191493141184764681 std::exp(var) is 0.000381141284723008938635502307335   So the results are different starting e-20:  PC:      0.00038114128472300899284561093161 Android: 0.000381141284723008938635502307335   Note that my program does a lot of math operations and I only noticed std::exp producing different results for the same input...and only for some specific input values (did not investigate if those values are having a similar property), for most of them, results are identical.   Is this behaviour kind of "expected", is there no guarantee to have the same result in some situations?  Is there some compiler flag that could fix that? Or do I need to round my result to end with the same on both platformas? Then what would be the good strategy for rounding? Because rounding abritrary at e-20 would loose too many information if input var in very small?     Edit: I consider my question not being a duplicate of . I get exactly the same result on both platforms, only std::exp for some specific values produces different results.
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?
p-value approach - clarify teacher's solution? So I have a question with my teacher's solution below and I'm confused about one of the steps in their solution. I would appreciate some clarification.  Two brands of coffee were compared. Two independent random samples of 50 people each were asked to taste either Brand A or Brand B coffee, and indicate whether they liked it or not. Eighty four percent of the people who tasted Brand A liked it; the analogous sample proportion for Brand B was ninety percent.   (A) At α = 0.01, is there a significant difference in the proportions of individuals who like the two coffees? Use the p-value approach.   So I circled in blue a step where I'm confused about in the teacher's solution. I don't understand why P(Z&lt;-0.89) = 0.2061.   On the z-score table -0.89 is equal to 0.1867 so shouldn't it be that value instead? where did 0.2061 come from? Is it possible that the teacher made an error or am I not understanding something? Every time I try to create a table using MySQL Workbench 6.3 CE it adds "broken" comments at the end of the script.  Example:  I am trying to create a table called "user". This is what the table should look like:   However when I click the apply button, the script generates incorrectly:  CREATE TABLE `user` (   `userid` INT NOT NULL AUTO_INCREMENT COMMENT '',   `record_status` INT NOT NULL DEFAULT 1 COMMENT '',   `createdby` VARCHAR(75) NOT NULL COMMENT '',   `createddate` DATETIME NOT NULL COMMENT '',   `updatedby` VARCHAR(75) NULL COMMENT '',   `updateddate` DATETIME NULL COMMENT '',   `username` INT NOT NULL COMMENT '',   `password` VARCHAR(75) NULL COMMENT '',   `firstname` VARCHAR(75) NULL COMMENT '',   `lastname` VARCHAR(75) NULL COMMENT '',   `email` VARCHAR(75) NULL COMMENT '',   `facebook_userid` VARCHAR(75) NULL COMMENT '',   `email_verified` VARCHAR(75) NULL COMMENT '',   PRIMARY KEY (`userid`, `username`)  COMMENT '');   The comment in this line should not be there, so the code should be:   PRIMARY KEY (`userid`, `username`));   and the code executes when I paste it into an editor and remove this comment. However I create massive databases daily. (Each with +- 15 tables). I can't keep doing this for each table as it is time consuming.  How can I disable this feature that adds the comments to the script? I don't need them in my databases Why do tuning forks have two prongs? I believe the purpose of a tuning fork is to produce a single pure frequency of vibration.  How do two coupled vibrating prongs isolate a single frequency?  Is it possible to produce the same effect using only 1 prong?  Can a single prong not generate a pure frequency?  Does the addition of more prongs produce a "more pure" frequency?  The two prong system only supports a single standing wave mode, why is that? show that $\sum_{i=0}^l \dfrac{{l\choose i}}{{n\choose k + i}} = \dfrac{n+1}{(n-l+1) {n-l\choose k}}$ Show that $\displaystyle\sum_{i=0}^l \dfrac{{l\choose i}}{{n\choose k + i}} = \dfrac{n+1}{(n-l+1) {n-l\choose k}}$ for all $k,l, n\geq 0$ with $k+l \leq n.$  The $k+l\leq n$ part doesn't seem that important. The claim clearly holds for $n=0,$ and in that case $k$ and $l$ must both be zero. I think the claim can be shown by induction, but I'm not sure how to do so; I'm not sure how to use the inductive hypothesis to prove the inductive step. The sum on the LHS is not always an integer, so finding a combinatorial argument doesn't seem very feasible. For $n = 1,$ we can have $(k,l) = (0,0), (1,0), (0,1),$ and in each case the sum holds. Perhaps multiplying both sides by a number (idk ${n-l\choose k}$) might be useful? How must I deal with anti-virus software on Windows 7 I know this question is looking like an easy question or not a question at all but it's not really easy question. I'm not related to security and anti-viruses and just don't trust every provided anti-virus.  So first question is a real question - Is it OK (safe) to not use anti-virus at all. I know how to use firewall, usually I use only trusted connections and surfing trusted sites. My chances to get virus is really low. Even I've got a bit outdated PC and don't want to pay the performance for it. I can do monthly scans without having one installed - is it OK to be safe ?  If not can you recommend a good free antivirus solution? What happened to Rhaegal? In Game of Thrones S08E03 ("The Long Night"), the Night King's dragon tore at the one Jon Snow rides (Rhaegal). He falls off of it and we don't see the dragon anymore, is it dead? How can I start automatically a command on Ubuntu 18.04? I have a small command like this  xinput set-prop "XP-PEN G430S Pen Pen (0)" --type=float "Coordinate Transformation Matrix" 1.155756, 0.000000, 0.000000, 0.000000, 1.529, 0.000000, 0.000000, 0.000000, 1.000000   to use my XP-PEN tablet, I have to start it automatically every time that I start my PC. How can I do that? Terms for collections of animals As I watched the murder of crows sitting on the line above my house this evening, I got wondering where all of the collective nouns for animals (pod of whales, gaggle of geese, pride of lions) came from and why we need so many.    If sheep can be a flock, why can't whales, geese, lions, and crows? Use of "Or", inclusive or exclusive? My wife and I are playing a game where you roll dice and move so many spaces in a grid "vertically or horizontally".   In the use of English it is very common to say, this or the other when it comes to making a choice  (exclusive or). Now I know that "or" can also be inclusive, for example "she couldn't read or write", or can be clearly used as an xor "you either come or not" making the statement true for only one of the options but not both.   My issue is where it is not clear whether it is an inclusive/exclusive or, the best example being our game.   I argue that you can move in either direction (inclusive) and the normal use of this conjunction in English should be inclusive unless specified otherwise.   Is this right? What is the C# equivalent of friend? Possible Duplicate:          I'd like the private member variables of a class to be accessible to a Tester class without exposing them to other classes.   In C++ I'd just declare the Tester class as a friend, how do I do this in C#? Can someone give me an example? Eclipse Shortcut to Split Long Strings I swear I've seen someone do this, but I can't find it in the various lists of shortcuts.  Given:  String s = "A very long ............................ String";   Is there an Eclipse shortcut to turn it into:  String s = "A very long ............................ "      + "String"; "ERROR: Extra }, or forgotten \right." in align* enviroment Why do I get a "ERROR: Extra }, or forgotten \right." in the following align* environment?  \begin{align*}     \int\left[\left(\der{E_z}{y}-\der{E_y}{z}-\mu\der{\alpha}{t}\right)\alpha&amp;+\left(\der{E_x}{z}-\der{E_x}{x}-\mu\der{\beta}{t}\right)\beta\\     &amp;+\left(\der{E_y}{x}-\der{E_x}{y}-\mu\der{\gamma}{t}\right)\gamma\left.\vphantom{\left(\der{E_y}{x}}\right]d\omega=0.     \end{align*}   thanks Split Line at Points not splitting at every point in ArcGIS for Desktop? Why does  not split at every point encountered, even if run in an iterative fashion?  Following the suggestions of a thread here and several others, I made a set of points in order to split polylines at specified intervals. In order to do this, I used linear referencing to turn my lines into routes. Then, I exported the attribute table, divided each length by 5, and set points at multiples of 1/5 the length of the line. I used this as the event table to create a layer of events. So, each line has 4 equally spaced points along it, and I thus ultimately need the 5 segments separated by those points.  Curiously, though, when I try to do the second part "Split Line at Point," it seems that only one point is used on a given line at a time, and I'm not sure how it chooses the point (maybe order in its attribute table?) I could run the tool multiple times, but this doesn't seem to solve the problem either. For example, I could see how it would continue splitting segments as more segments are generated, but on e.g. the 4th run I see that some lines are still only split 3 times, even though there is a point within a line segment that was never split and existed before I ran the tool. I'm not sure how the splits are generated, but in any case, it doesn't seem to do what I want it to do, which is produce a split at "each" point.  What should I do to split lines at ALL points along the line? I'd like to update the label of an operator when it's called. But this :  def execute(self,context):     self.bl_label = "good night"   ... apparently doesn't work if the bl_label property has already been defined. Am I wrong ? StringTokenizer? Convert the String to a char[] and iterate over that? Something else? Image UriSource and Data Binding Cardinal number subtraction We all know that $|\mathbb{N}| = \aleph_0$. Since $|\{-1\} \cup \mathbb{N}| = \aleph_0$ as well, I guess you could say that $\aleph_0 + 1 = \aleph_0$.  You can go on to derive that $\aleph_0 + \aleph_0 = \aleph_0$, and by induction $n \times \aleph_0 = \aleph_0$ (assuming that $n$ is finite, anyway).  Now, here's a thing: What is $\aleph_0 - \aleph_0$?  Well, $|\mathbb{P}| = \aleph_0$, and $|\mathbb{P} \backslash \mathbb{N}| = \aleph_0$, so perhaps $\aleph_0 - \aleph_0 = \aleph_0$?  No, wait. Consider the set $S = \{n \in \mathbb{N}: n &gt; 5\}$. Now we have $|S| = \aleph_0$, and yet $|\mathbb{N} \backslash S| = 5$. So maybe $\aleph_0 - \aleph_0 = 5$?  But that is absurd, since we can redefine $S$ to make the result any finite number we wish. Or we can define $S$ such that the result is countably infinite.  Does this mean that the notion of $\aleph_0 - \aleph_0$ simply has no definite answer? Or am I just being too simplistic here? Let $A_n$ denote an $n \times n$ tridiagonal matrix.  $$A_n=\begin{pmatrix}2 &amp; -1 &amp; &amp; &amp; 0 \\ -1 &amp; 2 &amp; -1 &amp; &amp; \\ &amp; \ddots &amp; \ddots &amp; \ddots &amp; \\ &amp; &amp; -1 &amp; 2 &amp; -1 \\ 0 &amp; &amp; &amp; -1 &amp; 2 \end{pmatrix} \quad\text{for }n \ge 2$$  Set $D_n = \det(A_n)$  Prove that $D_n = 2D_{n-1} - D_{n-2}$ for $n \ge 4$. When should I publish in interdisciplinary versus subject-specific scientific journals? Most science research is published in subject-specific journals, of which there are many. However, there are a relatively small number of interdisciplinary journals, some of which are the most highly cited of all journals (Nature, Science); others have impact factors comparable to subject-specific journals (e.g., PLOS ONE, J. R. Soc. Interface, etc.).  If we discount arguments around open science and similar business model arguments (which could favor journals like PLOS ONE), and assume that the purpose of publishing is simply to get your research read (and cited) by the largest "relevant audience", when should one publish in an interdisciplinary journal versus a subject-specific journal (assuming they have comparable impact factors)? (Are there any papers out there that compare the fate of publications [or their authors!] in the two different types of journal?)  Thanks in advance. I installed vsFTPd for running an FTP server on  (Wheezy). I checked the vsFTPd version was 2.3.5, and I configured it like so:  listen=YES local_enable=YES write_enable=YES chroot_local_user=YES pasv_min_port=15000 pasv_max_port=15200 allow_writeable_chroot=YES   I followed these articles for solving this problem:       And many others on Google and forums, but my problem was not solved.  NOTE: I have solved this problem on  (Precise Pangolin), but that solution does not work on Debian 7.3.  I really mixed up on it?!