Code  public class test{     public static void main(String[] args){         double first = 3.14 ;         first++;         System.out.println(first);     } }   Result  ubuntu@john:~/Desktop$ javac test.java  ubuntu@john:~/Desktop$ java test   Output : 4.140000000000001  I am getting expected answer for almost every other case... Eg : For 4.14 ,result is 5.14...  Why this case is special ?
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
My interest in combinatorics was recently sparked when I read about the many things that the Catalan numbers count, as found by Richard Stanley. I picked up a copy of Brualdi's Combinatorics, and while browsing the section on counting sequences I found a nice little puzzle that has definitely puzzled me.     Let $m$ and $n$ be nonnegative integers with $n\geq m$. There are $m+n$ people in line to get into a theater for which admission if $50$ cents. Of the $m+n$ people, $n$ have a $50$-cent piece and $m$ have a $\$ 1$ dollar bill. The box offices opens with an empty cash register. Show that the number of ways the people can line up so that change is available when needed is   $$ \frac{n-m+1}{n+1}\binom{m+n}{m}. $$     I first noted that the first person to enter must be one of the $n$ with a half-dollar. Now the register has a half-dollar change. The second person can be either a person with a half-dollar or a dollar. In the first case, the register will now have two half-dollars, in the second case, the register will now have one dollar bill. So it seems to me that when one of the $n$ people with a half-dollar enters, the number of half-dollars in the register increases by $1$, and when one of the $m$ people with a bill enters, the number of half-dollars decreases by $1$ but the number of bills increases by $1$.   I tried to model this by looking at paths in $\mathbb{Z}^2$. The $x$-axis is like the number of half-dollars, and the $y$-axis is the number of bills. You start at $(0,0)$, and you can take steps forward $(1,0)$ or backwards diagonally $(-1,1)$ corresponding to who enters, but you must always stay in the first quadrant of the plane without crossing over the axes. The goal is to make $m+n$ moves, and I figured maybe the number of such paths is counted by $\frac{n-m+1}{n+1}\binom{m+n}{m}$, but I'm not sure how to show this. I don't know if this observation simplifies the problem at all, as I don't know how to finish up. I'd be happy to see how this problem is done, thank you. Negative pressure How is negative pressure created in a fluid system?Isn't it counter intuitive that we are reducing the pressure of a system containing no molecules(zero pressure) to a lower value? Before you disagree with me with a downvote, or just want to be funny, please hear me out. From the :  The upvote privilege comes first because that's what you should focus on: pushing great content to the top. Downvoting should be reserved for extreme cases. It's not meant as a substitute for communication and editing.  I have honestly never seen a downvote reserved for an extreme case. The process is usually 1) downvote post if it's bad and don't comment. (Not much of a process, is it?) As you stay on the site longer and longer, you develop a carelessness towards downvotes (as I have), but for new users, it's really discouraging.  question inspired me to [ask balpha to] make , which is a list of users with 1 rep who have the  badge. That's the closest I could get to new users who deleted their own posts after downvotes came in. Don't get me wrong, I know the argument about being nice to new users very well, but I still believe it to be an issue. And since , users are much more inclined to go the lazy route and downvote bad questions. No alternative measures (see below) are taken, for the most part. Personally, I leave a comment and don't downvote until the asker shows no interest in fixing their post. The only other measure taken to discourage downvotes (on answers) is the -1 rep punishment to the downvoter, which is absolutely meaningless and inconsequential anyways. How are we supposed to educate new users when we don't teach them what to do, don't direct them to the FAQ, and discourage them with downvotes right off the bat?  Instead of voting down: If the post is spammy or offensive — flag it. If the question is duplicate or off-topic — flag it for moderator attention. If something is wrong, please leave a comment or edit the post to correct it.  We claim to discourage downvoting, yet I see answers like  that encourage us to downvote first and ask questions later when a question is simply unclear or effortless. It's just an awful chain reaction. A new user comes to the site asking a question, but that doesn't work out too well, so they get downvotes, delete the question in shame, and don't get the help they deserve as a fellow writer of code and programmer. Strip away the quality of the site for a moment: the core functionality of this site, and the only reason I and a lot of other users are (still) on it, is to receive and give help to/from others. I enjoy making sure fellow programmers get the answer they need, because this site has helped me get mine when I needed them. Quality can still be maintained if content is fixed rather than downvoted more often. So can we stop discouraging new users from continuing to use this site and actually start to discourage downvoting? I think we need to encourage effort towards teaching and helping new users understand the system and why their post is bad rather than slapping them in the face with downvotes that they don't know how to interpret anyways. I'm leaving ways we can do this up to others. My first thought was to increase the punishment for downvoting answers and to no longer make question downvotes free, but those wouldn't be well-received, judging by the history of similar suggestions. . How to install qt 4.8 from repository? How to install qt 4.8 and QtCreator from repository ? What are the most common pitfalls awaiting new users? Requesting an active user page In my opinion, providing us with an active user page that shows the list of recent active users is useful as we can monitor the active users without visiting each user profile.  The list can be arranged in a grid of m rows by n columns and accompanied by labels representing the their reputations (and other info that you think they are important) and activities  such as "seen 2 minutes ago".  The following figure illustrates my idea. I am sorry. There is a typo in the following figure, Active must be changed to active to make it parallel to the other existing labels.     I think it is not too difficult to implement this. By adding a new action method and editing the view, done!  Of course it is not urgently requested feature. If it is useful, it can be put in the development to-do list so it can be implemented together with other useful requests at once.  Any responses are welcome! Regardless of how difficult it is, could you explain whether or not there are negative effects of this request? Down voting without informative comments looks barbaric. :-)  Edit:  If it is about user privacy, why is there a "seen 2 minutes ago" in the user profile page? I don't think there is a difference if we implement this feature. Possible to replay repetitive tasks using Python? Deleting photos on the phone - does it affect them on iCloud? Flying with a desktop computer (as checked luggage) On an upcoming trip, I will be taking a desktop computer and monitor as checked luggage (on a United/Continental flight). What should I be aware of when doing this? What needs to be done to properly protect all the components? Are there any airline policies I should be aware of? Use of 'const' for function parameters Get TEXT value of a CLOB OID in Postgresql How to make two feature layers congruent using ArcGIS for Desktop? I have two feature layers (polyline/polygon) which should be congruent but there's an offset of about 220 meters.   The Georeferencing tool only works with raster layers.   How do I do the equivalent with a feature layer? TV series from 70s or 80s - 1 female pilot was cloned from the other pilot's fingernail This was a tv show that aired in the US in the '70s or early '80s, possibly on Saturday mornings. Since I was a child, I'm assuming it was a kids program? It was comic science fiction and set on a spaceship. The only 3 specific details I remember are:   The crew traveled between ship levels by using open "jump tubes" that were similar to a giant vacuum tube message system, only without any "container" for the passenger. They just stepped into an alcove with a big hole in the floor and ceiling, then shot up or down. Frequently the show would use this as a source of slap-stick comedy.  The captain was male. The 2 pilots were female, and 1 had been cloned from the other's fingernail cell. They often disagreed about which one was the clone. What is the size of an enum in C? I'm creating a set of enum values, but I need each enum value to be 64 bits wide. If I recall correctly, an enum is generally the same size as an int; but I thought I read somewhere that (at least in GCC) the compiler can make the enum any width they need to be to hold their values. So, is it possible to have an enum that is 64 bits wide? I am using latest version of VirtualBox (VirtualBox 4.3.6 for Windows hosts) and after installing any OS and clicking inside of it mouse disappear. It is not visible until I press right CRTL. Anyone know what can cause this problem. I have also installed extension pack. Is there a limit to the number of Power Armor sets you can keep? I've seen videos of some folks having several armor sets (4 is the most I've seen so far) standing about on their settlement. I'm wondering if having too many would cause some sets to disappear. They're not like guns/items that you can safely store in settlement crates, the suits kind of just... stand around. (I know there's the extra step of taking out the fusion cores, so that NPC's don't use them.)  Is there a limit to the number of Power Armor sets you can keep? Are there attacks that break collision resistance but not preimage resistance? Are there any examples of attacks on hash functions which:   break collision resistance and second preimage resistant, or break collision resistance and preimage resistant?   I have looked at Rogaway's paper1, but it seems complicated, hence was wondering if a succinct example exists.  1)  Phillip Rogaway and Tom Shrimpton. Fast Software Encryption (FSE) 2004, LNCS vol. 3017, pp. 371&ndash;388, Springer, 2004. Suppose a vibrating fork exerts force to the air particles to compress which leads to the increase of internal energy (heat).This heat or energy given by the fork is given to the next layer of air and in this way, this energy makes sound. But if it was so, it will be isothermal. And Laplace told it was adiabatic. How can it be? I am confused. The heat energy infact is the energy given by the fork. If it is adiabatic, how can the air pass this energy ? Is there a way to create synchronization profiles for Google Chrome? For example I want to tag some of my browsers as "home browser"s and others as "work browser"s and I want:   my bookmarks to be synced with all browsers, my extensions to be synced only within browsers of the same type (home with home, work with work) When in Journey Builder what is the difference between journey data and contact data? I am creating a JB with an engagement split. What is the difference between Contact Data and Journey Data. ie what will I see listed in the two groupings. If I choose the journey data will this only be as up to date as the time that the data entered the Journey?