Why are my doubles being returned out by a tiny fraction?

This might be better in the beginner forum.
Instead of 2.0 I'm getting 1.99999999999999999999996 or something.
Anyone know why this is happening and what is the solution?
While I'm at it ... there's no in-built Java function to round a number to x decimal places is there?

I figured the uncle was imaginary, although I thought there must been some kind of trick to the question as the "not enough information" answer was the first thing I thought after reading it.
One example of probability that I was surprised even my "math genius" friends (meaning guys how graduated with honours in maths) could not quite wrap their hand around was this:
There are 5 players in a card game and each players is dealt four cards face-down from a deck of 52. Each player looks at his card in secret. The firth card is dealt after the players have looked at their cards and is a community card to be used by everyone. Player 1 looks at his cards and is holding the jack of hearts, 10 of hearts, queen of hearts and king of hearts. Given this information, what is the chance that the very next card will be the ace of hearts to make his royal flush?
For me the answer is obvious immediately, and that's what I'm talking about when I say I "get probability". Don't ask me any sort of "conventional" maths questions though, I'm hopeless. That really lets my programming down badly when it comes to algorithmics in my code. If I have a problem, I can usually come to the right answer using a naive and convoluted kind of logic - and after frying my brain struggling with it - only to find someone else has done the same thing with a much more elegant and straightforward algorithm using one-quarter the lines of code.

Similar Messages

  • Why are my emails being sent out multiple times, ie from me mac and icloud?

    Hi. When I send an email from Mail program it sents from each option, ie mac, me and icloud...

    Mail > Preferences > Composing > Send new message from:
    Select the address you want.
    Best.

  • Why are my emails being sent as "Apple Inc" and how do I change it?

    Why are my emails being sent as "Apple Inc" and how do I change it?

    See:
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    If not successful, an appointment at the Genius Bar of an Apple store is usually in order.
    Apple Retail Store - Genius Bar

  • In iTunes under my device, under the apps tab, Why are all the options shaded out?  I cannot make any changes, select any apps or do anything with the apps.  I was able to load a few apps and sync but cannot sync anymore to my phone.

    In iTunes under my device, under the apps tab, Why are all the options shaded out?  I cannot make any changes, select any apps or do anything with the apps.  I was able to load a few apps and sync but cannot sync anymore to my phone.

    Hi,
    ( I search for iChat questions when I have finished in the iChat Forum)
    So the menu bar reads iChat, File,  Edit,  View, Buddies, Video, Window and Help
    There is no Buddy List open.
    There is no other window for iChat open.
    In the iChat Menu you only have access to Status.
    Is an item ticked in the list ?
    Is this a green (Available item) or  Red ( an Away one) ?
    Can you access the Accounts option ?  (Sitll in the iChat Menu)
    Is anything in here ticked ?
    In the Window menu any Logged in account should appear in the list  (Between the Next Chat and File Transfer items)
    It would be useful to know which version of iChat this is.
    If no account is ticked (iChat Menu > Accounts) or not showing in the Window Menu, plus you cannot determine the Status and you cannot access the Preferences then you need to access your Home Folder/Library/Preferences
    As the Library in the Home Holder is Invisible in Lion you will need the Finder's Go Menu > Go to Folder option  (you can use it in earlier OS versions if you want)
    Type in:-
    ~/Library/Preferences
    Find the file called com.apple.ichat.plist
    Drag it to the Trash and Restart iChat.
    This will lose all the settings in iChat that you have changed from Defaults but there is no way around this.
    9:23 PM      Saturday; August 27, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • TS2755 Why are SMS messages being undelivered?

    Why are SMS messages being undelivered?

    some detail?  to you - from you?  to another i message user?   the pad is not a phone, and will only message to other i message users.

  • SnippetPreview$.htm - Why are these not being deleted?

    I have the following files in my project folder:
    SnippetPreview$.htm
    SnippetPreview1$.htm
    SnippetPreview2$.htm
    SnippetPreview3$.htm
    SnippetPreview4$.htm
    I noticed them because they are not in Visual SourceSafe so they appear when I go to add files to VSS when I create new snippets. They contain the text of snippets I've created.
    I know they are harmless, but why are they not being automatically deleted from RH when no longer needed?
    Is this a setting or preference I can set?

    Sometimes temporary files are left behind. These are just files created on previewing a snippet and like any other temporary files are not deleted. Just delete them.
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • Why are all disks being ejected from my MacBook Pro?

    Why are all disks being ejected from my MacBook Pro?

    Likely that your optical drive is either failing or has a dirty laser lens and cannot read the disks.....

  • Why are my messages being sent through email rather than iMessage?

    Why are my messages being sent as email rather than iMessage?

    Not being sent as email - shown as being sent from an email address because you have selected to start new iMessage conversations from your Apple ID email address on your iPhone.
    When registering an iPhone with iMessage, the phone number along with your Apple ID email address is registered with it.
    Go to Settings > Messages > Send & Receive > Start New Conversations From - select your iPhone's phone number.

  • Why are my podcasts being deleted from my iPhone every time I sync them?

    why are my podcasts being deleted from my iPhone every time I sync them?

    I also have this problem though it only seems to affect my iPod Nano (6th gen).  It does not seem to affect my iPhone (though now as I type this, I better confirm that as I haven't manually managed podcasts on my iPhone since the last iTunes updates).  I have iTunes set to "manually manage music and videos" (just like OP, I'd rather manage music and videos myself rather than construct playlists and have iTunes sync them), and under the "Podcasts" tab on my nano, I do not have "Sync Podcasts" checked.
    Is this something that has occurred since the last iTunes update?

  • Why are my apps kicking me out

    Why are my applications kicking me out and sending back to the home screen? Also, my battery dies much faster than normal

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • Why are the emails I sent out being held in my outbox, and how do I resend them

    why are the emails that I have sent out not going to the recepiants but instead being held in my outbox, and how do I resend them?

    This problem is generally caused by not having a connection to the ISP mail sender (send and receive authenticate and operate independently).
    Mail > Window > Connection Doctor ...
    ... to look into it.

  • Why are my song being cut off, not all just some?

    Some of my songs that I bought on itunes are being cut off when there is about 30 seconds left to the song, both on my iphone and my macbook.  I dont know why this is happening. any help would be grealty appreciated.

    Are the episodes being shortened when you publish to a local folder and launch them in the browser as well as when published to the server? See this page under "Troubleshooting"...
    http://www.iwebformusicians.com/iWeb/iWeb-Tips.html
    If the local files are OK it would suggest the problem is on the server. Otherwise you need to troubleshoot iWeb.
    If the problem is files that are too large, you can reduce the sampling rate and/or convert to mono if the content is mostly speech rather than music.

  • Why are MobileMe users being forced to switch to iCloud?

    Add me to the list of MobileMe subscribers who are not happy about the chance to iCloud.  I was very happy with MobileMe.  I'd much rather pay for a good product vs. being forced to use an inferior free product.  I back up all my work data to MobileMe/iDisk and I am concerned that it will not be transferred and that I may run into problems in the future.  A previous post that I just read said that data will not be transferred.  Is this true??  Also why are photos and videos not being transferred?  Can they at least be manually reloaded?

    Apple have decided to terminate MobileMe - they did give a year's warning of this - eleven months ago.
    iCloud does not provide general file storage of much in thue way of a Gallery; you will need to download any files which you do not already have on your Mac before the end of June.
    If you want to continue with online storage and galleries you will have to find a third-party alternative. These pages examine some options:
    http://rfwilmut.net/migrate3
    http://rfwilmut.net/migrate4

  • Why are random spaces being inserted in text on Acrobat Pro 9?

    My apologies if this has been asked & answered before. I did try and search and found some information but I still do not understand the complete picture.
    I am a relatively new user to Acrobat and used 7 prior to upgrading to Pro 9 recently.  I am using it for basic functions only at this point, combining multiple word (Microsoft Word 2003) documents from various authors.  Since upgrading to 9 I have come across a few instances where there were random spaces inserted in the PDF document. These spaces are usually between words or in the middle of words and can be just one or two spaces or 10+ spaces.  After doing some research I think I figured out that these spaces occurred after I had used the Touch Up Text tool to fix a small mistake (likely spelling).  After more research I went into the Change Conversion settings option in Word and removed all of the fonts listed in the 'Never Embed' section of the Fonts tab under advanced settings.  This seemed to solve the problem for a while but now it is occurring again.
    So, my questions are:
    1. Can someone explain to me if my research is correct and using the Touch Up Text tool is what caused the spaces in the first place?
    2. What can I do to ensure that this does not continue to happen while still being able to use the Touch Up Text tool occassionally?
    3. Is there something I am missing? (Highly likely given my lack of experience with Acrobat!)
    I truly appreciate any insight that can be offered. Unfortunately I cannot offer any examples to show you what is happening as I work in a legal environment and I have yet to be able to re-create the issue with something not sensitive.
    Kim

    There is really nothing like a space in an Acrobat pdf file. Each letter is positioned on the page according to the Acrobat language specification (similar to the postscript language). When you edit a pdf file anything can happen. I've seen changing one letter completely screw several lines of text (except for the fact that a line of text is not a pdf concept either). The best recommendation is to edit the original documents---not the pdf file. Sometimes it cannot be helped. Sometimes it works sometimes it doesn't. There are no workarounds for changes that occur when you edit the text in a pdf file.

  • Why are my pics being automatically rotated from landscape to potrait??

    Background: I use a Nikon D90. I have used a Windows machine up until this week, and never had this issue. I spoke with customer service for over an hour trying to resolve this issue, fail. I take pictures of guitars. Every single picture is a landscape picture. I have set Image Capture as my default program to import pictures. When I connect the camera, the program turns all the pictures of guitar necks to portraits. iPhoto did the same, I use Image Capture because I can set a destination for my import. This is the issue. _I want to import my pictures exactly how I take them, all in landscape._
    The windows machine never did this. I'm positive it isn't an issue with the camera. Out of all the pictures, it only does this with the guitar necks. I think the Mac is trying to "help" me by rotating my pictures for me. But they aren't pics of trees and they don't need rotated.
    What do you guys think?
    Can I attach a screenshot? I don't see an option...

    I've used windows machine in the past, with the same camera and a few different import programs, and have never had this issue before.
    Do those machines/programs support the auto-rotation feature of your camera? That is, if you take a picture in portrait orientation, do they show it rotated?
    I'm not sure why the images of the neck are rotated... if, as you say, you took this photo in landscape orientation, with the bottom of the camera toward the ground, then there's no reason for them to be rotated unless your camera has a feature to auto-rotate based on the image content. I'm not finding any documentation of such a feature in a Nikon D90, though I didn't look very thoroughly.
    One question: I can't tell from the photos, but it looks like the ones showing the issue could have been taken from above. If that's the case, this could be your problem. If you were shooting from above and took a picture of the body, then moved the camera, then took a picture of the neck, that could cause what I'm seeing. Keep in mind that your camera's accelerometer has no way of knowing that acceleration from movement is different from acceleration of gravity. Sliding your camera to the right on a rig might fool the camera into thinking it was rotated 90° counterclockwise, as shown in the photos of the front of the guitar, and sliding the camera to the left on a rig could make it think it was rotated 90° clockwise, as shown in the photos of the back of the guitar. With the camera pointing straight down, gravity would not re-orient the accelerometer as soon as the movement stopped.
    That's just a theory, I have no way of knowing whether the camera would actually behave as I describe.
    Is this question in the right forum?
    Probably... if you were using iPhoto, it would be better in the iPhoto forum, but you're using Image Capture, which makes it a little less clear-cut.

Maybe you are looking for