Has anyone else noticed a double subtraction problem?

double value = 0.910;
double one = 1.000;
double afterSub = one - value;
System.out.println(afterSub);
Prints:
0.08999999999999997
I am developing on a Windows XP system with all current Patches installed.
Using Java 1.4.2_04 (have also tested _05-b04, _01, _02, _03 and on Windows 2000, XP with latest service pack [multiple machines])
Seems that lower double subtractions like 1.00 - 0.11 work fine, but as the second number approaches 1.0 the error increases.
I have someone testing it on a Mac and on Solaris but haven't heard back from them yet.
Am I doing something wrong? Has this been fixed in a later version? I checked the bug base but couldn't find anything about this (this could be user error.)
Any help would be appreciated.
Thanks.

This question is off topic for this forum. In the future please post to a more appropriate forum. Although I'm not sure I see the issue here. You are subtracting two double precision floating point numbers. The computer can not represent .09 exactly so it approximates the value to 0.08999999999999997 which is pretty close. If your going to be doing floating pont math you should probably look at the java.math package.

Similar Messages

  • I've noticed that when wearing headphones the sound is much louder in the right headphone than the left one. This wasn't a problem before.  Has anyone else noticed this? Is there a fix if so?

    I've noticed that when wearing headphones the sound is much louder in the right headphone than the left one. This wasn't a problem before.  Has anyone else noticed this? Is there a fix if so?

    Did you try different headphones!?
    If it's sounding the same thing on different headphones then you might have changed the Left-Right balance
    Have a look at Settings -> General -> Accessibility
    There's a slider for L-R
    If it's in the center then the headphone through which you're facing the problem might be damaged, try twisting the headphone wire of the speaker of the headphone (left or right) where you are encountering less volume.
    If it's sounding altogether same on all the circumstances, the headphone jack might be damaged. Get your phone to the Apple Store and book an appointment
    Try these steps and it will solve your question

  • HT1222 Has anyone else noticed much greater battery consumption since iOS 5.1.1 update for iPhone?

    Since iOS 5.1.1 update has anyone else noticed a much greater battery consumption on all fronts? My phone used to rock steady all day and know is around 47%  12 noon to 1 pm with the same amount of usage.

    Heres a support question... how the **** do I fix the dramatic battery drain problem that came about after installing 5.1.1?  Suggestions for fixing problems on iTunes did not work.

  • Adobe is great software but has anyone else noticed that Corel has a better line drawing tool?

    Adobe is great software but has anyone else noticed that Corel has a better line drawing tool? I end up doing all my line drawing in Corel because it is so simple and then importing it into adobe. You would think, with all these updates that they are constantly doing Adobe would think to simplify it's pen tool. I'm talking about the pen tool in illustrator. Don't even get me started on the bloody rubbish pen tool they've got in photoshop. It makes deep etching something properly a really agonising task.

    I'm not sure that I followed everything, but you got a replacement phone and continue to experience problems? It sounds like a logical move would be to have AT&T replace your SIM card. I would doubt that the size/fit is an issue, these things are a standard size, but replacing the SIM will have an impact on the network set-up that might be the root cause.

  • Osx 10.7.4   safari 6.0  when I add a new bookmark to the "bookmarks menu" it is added somewhere in the middle instead of at the end of the list.  this just started a few days ago after an update.  Has anyone else noticed this?.

    osx 10.7.4   safari 6.0  When I add a new bookmark to the "bookmarks menu" it is added somewhere in the middle instead of at the end of the list.  This just started a few days ago after an update.  Has anyone else noticed this?.

    Just for those who are interested, this is what cleared the "bookmark menu"  trbl I had.
    Open System Preferences > iCloud
    Deselect the box next to Bookmarks, then reselect it.
    Quit and relaunch Safari. Try a bookmark again.

  • Has anyone else noticed this bug with multitasking gestures on iOS 5?

    I recently updated my iPad 2 to iOS 5 and have just noticed this bug with multitasking gestures. 
    If you're currently in an app and use the four-finger swipe up to open the app switcher, and then subsequently close another app that's open in the background from the switcher, the app doesn't seem to fully close.  What I mean is that if you now use the four-finger swipe right/left to switch apps, when you get to the place where that app you closed was, it's still open, and after you view it, it pops back into the app switcher.  It seems like the multitasking gestures feature isn't recognizing that you've closed the app and that it should skip it from now on. 
    If you do the above steps again, but this time after you close the app from the switcher, use the five-finger pinch to go back to the home screen, it seems to clear the "cache" being used by the the gestures feature.  Now if you go back into any app and swipe left to right, the closed app won't load up anymore (which is how it should correctly work). 
    Has anyone else noticed this, or can anyone else reproduce the bug as I described?  I'd appreciate it if an Apple employee could confirm that this is a bug in iOS 5 and not just something wrong on my end.  Thanks in advance. 

    02-May-200702:03 PM
    scoobyman wrote:
    Hi keffa
    After the time spent and attention to detail in replicating this fault, I do think that you should email your findings to Nokia Care to be found on:
    http://www.nokia.co.uk/A4222231
    This is after all a discussion forum and others may find the same bug, but until it is logged at Nokia there is little chance of future modification if required!
    Done already. They may of course have corrected this in the 11.x firmware currently being rolled out but as I don't yet have access to it I can't say.
    Useful links: Phone firmware update | Nokia support site

  • Using Adobe PhotoShop CS4, I cannot add text to a new layer. It was always a snap with previous versions of OS 10. Has anyone else noticed issues with CS4 and Lion? Many thanks in advance. Pete Hendricks

    Using Adobe PhotoShop CS4, I cannot add text to a new layer. It was always a snap with previous versions of OS 10. Has anyone else noticed issues with CS4 and Lion? Many thanks in advance. Pete Hendricks

    Happy to report that iTunes Match has returned to working like normal on iTunes 10.7 on my computer today. If any iTunes engineers read this thread, I really appreciate the fix.
    Has it returned to normal for you?

  • Has anyone else noticed that the iOS 6 Maps App is missing the area code for many places it has listed?

    If I try to look up a local business on the Maps App it drops a pin on all of the locations matching my search parameters. However, when I get details about a dropped pin, the phone number is usually missing the area code! For example, if the phone number is +1 (123) 555-5555 it would show up as +1 (555) 555-5. This makes it impossible to call directly from the maps app or to copy and paste infront of a manually entered area code (because of the '+1'). Has anyone else noticed this?

    Have you checked to make sure that your region settings are correct?
    Settings>General>International>Region Format

  • App store doesn't show Mac OS X Lion 10.7.3 as purchased and will resell it to me has anyone else noticed this?

    The Apple app store doesn't show Mac OS X Lion 10.7.3 as purchased and will resell it to me. I bought this computer (early 2011 macbook pro 17 in) new in oct 2011 it came with Lion installed has anyone else noticed this?

    Barney,I did as you suggested and emailed app store support qutioning why the app store didn't recognize my OS LION software as purchased even though all of the iLife apps that came bundled with it are recognized as PURCHASED and here was the email response from robert@ the app store....< I understand that you are trying to re-install the OS X Lion as you had a Hard Drive crash but it is not showing as purchased from your Mac App Store purchase pane.
    As the Mac OS X Lion was pre-installed to your computer , it will not be recognized as purchased in the Mac App Store, and because of that it is not available fro re-download for free. Also, computers that come preinstalled with Lion do not ship with the disk.
    Dana, not worry as OS X Lion has a self recovery feature.
    This article will guide you on how to re-install OS X by Lion Recovery :
    OS X Lion: About Lion Recovery
    http://support.apple.com/kb/HT4718
    This article may also help you on the recovery process:
    OS X Lion: About Lion Recovery Disk Assistant
    http://support.apple.com/kb/HT4848

  • Has anyone else noticed that Adobe Camera Raw 7.x exhibits odd behavior compared to version 6.x?

    I have found no discussion of this subject on Adobe's forums, so I am asking here. I find that Adobe Camera Raw 7.x's "auto" mode frequently produces overexposed images with lots of blowouts necessitating much more manual tweaking than was required with the older 6.x series of plug-ins. Has anyone else noticed this behavior?

    I have found no discussion of this subject on Adobe's forums, so I am asking here. I find that Adobe Camera Raw 7.x's "auto" mode frequently produces overexposed images with lots of blowouts necessitating much more manual tweaking than was required with the older 6.x series of plug-ins. Has anyone else noticed this behavior?

  • In FF29.0 bookmarks on the menu bar stop working correctly after exiting 'Customize': has anyone else noticed this?

    Shortly after installing FF29.0 I noticed that the bookmarks menu from the 'Menu Bar' - NOT the new one that appears on the right of the screen - was not working correctly: specifically, when right-clicking on a bookmark to look for 'Open in a New tab' all the options were greyed out and I now realize that this occurs after exiting the 'Customize' screen, which effect I have consistently duplicated several times now; to restore functionality I have on each occasion had to close and re-open Firefox. This error does not appear to occur with the new bookmark menu that is associated with the bookmark icon at the top right of the screen. Has anyone else noticed this error?
    (Personally, I prefer the bookmark menu from the menu bar, which incidentally I find easier to read than the new one and I like menu bars anyway.)
    Many thanks.

    Thank you for your input. If you have more input on the new features please check out [input.mozilla.org]
    The bookmar bar is still available with the add on bar add on. Check it out in [addons.mozilla.com]

  • Has anyone else had a screen separation problem with the ipad?

    Has anyone else had a screen separation problem with the ipad?

    Does it really matter whether anyone else has? If you have, that's a problem for you whether or not anyone else has experienced the same issue. Call Apple tech support or take the iPad to an Apple Store, if there's one in your area, and they'll replace the iPad unless it's determined that the problem was caused by some sort of accident rather than a factory defect.
    Regards.

  • Has anyone else noticed their macbook air (11-inch, Late 2010) fan running constantly?

    Since i updated to 10.8.4, i've noticed the fan is running almost constantly on my Macbook Air (11-inch, Late 2010) and the computer gets very hot. I looked in Activity Monitor and saw that both Safari and Finder were using CPU, but it's by no means spiked. Anyone else notice this?

    Try resetting your system's System Management Controller (SMC) to see if that helps the problem. The SMC is responsible for managing the feedback for the fans to respond to temperature changes.
    See here for how to reset it for your system: http://support.apple.com/kb/ht3964

  • Has anyone else noticed this bug in the 10.x firmw...

    A vibrate issue I have noticed in the 10.x firmware. Steps to replicate...
    1. Put phone into silent mode or any other mode where the phone is set to vibrate when a call comes in (You can actually do this at any point before step 4).
    2. Put your N95 into landscape mode and watch a video or play music (You may optionally plug in some headphones if you wish).
    3. Close the video down, take headphones out, put phone back into standby.
    4. Call yourself or get someone to call you from another phone.
    5. Your phone will not always vibrate when the call comes in even though its supposed to. I tried this ten times and it only vibrated as it was supposed to during 3 of those attempts.
    So far I can't work out whether this is caused by inserting headphones or making use of the media buttons by sliding the slider down.
    Anyone else noticed this?
    Useful links: Phone firmware update | Nokia support site

    02-May-200702:03 PM
    scoobyman wrote:
    Hi keffa
    After the time spent and attention to detail in replicating this fault, I do think that you should email your findings to Nokia Care to be found on:
    http://www.nokia.co.uk/A4222231
    This is after all a discussion forum and others may find the same bug, but until it is logged at Nokia there is little chance of future modification if required!
    Done already. They may of course have corrected this in the 11.x firmware currently being rolled out but as I don't yet have access to it I can't say.
    Useful links: Phone firmware update | Nokia support site

  • Has anyone else noticed that Iphone 3G tray is larger than AT&T's sim card?

    Hello,
    Just a brief history of my iphone to start. Purchased in December of 09 via Best Buy. About 3 months ago I started to have connectivity issues with the Iphone. I would not receive notices of people calling and my text messages would come 12-48 hrs later than when they were sent. I called AT&T first regarding the issue. They pointed the finger at Apple and said it was their issue, I felt that it was their issue. I blamed their 3G network for the issue, as well as stating that they do not keep their end of the bargain regarding the best 3G network. I threatened a class action lawsuit against them regarding the false claims of their cellular network in Wisconsin being available to my area. That aroused someone because before I knew it I was being told that I would get a new phone. I received the new phone within 5 days. The phone I received is no better than my previous iphone. Same issues as stated above, as well as searching for service, showing one bar with the edge symbol, and having the phone remove the edge symbol when making a call. It's ridiculous to say the least. So one of my questions is, can Apples hardware or software be the issue or is it a case of AT&T network being non compatible with Apples hardware or vice versa? Let me also state that its not just me with these problems where I live(Area code 53559) but others as well with the Iphone 3G. Here is the funny part, one of my friends has the 3Gs and his phone does great where I live, 4-5 bars constantly to my one or none. This brings me to believe that the 3Gs hardware is different some how? Antennae?etc. Is this true? I'm at my ropes end trying to get my phone to work like it should. I'm also exhausted dealing with the blame game between Apple and AT&T. If anyone has any answers or advice I would appreciate it very much. Regarding the Subject of this post, does anyone else's card come up short of fitting(Could this contribute to the connectivity issues?) the tray perfectly front to rear?
    Message was edited by: yokomo

    I'm not sure that I followed everything, but you got a replacement phone and continue to experience problems? It sounds like a logical move would be to have AT&T replace your SIM card. I would doubt that the size/fit is an issue, these things are a standard size, but replacing the SIM will have an impact on the network set-up that might be the root cause.

Maybe you are looking for