Can anyone please explain this double problem?

public class DoTest {
     static int i;
     public static void main(String[] args){
          double a = 3.0;
          double b = 0.3;
          double c = 0.3;
          double d = 0.3;
          System.out.println(c+a+b);
          System.out.println(d+c);
}Result:
3.5999999999999996
0.6
Why does the first println statement return 3.5999999999999996?
Cheers

import java.text.DecimalFormat;
public class DoTest {
     static int i;
     public static void main(String[] args){
          double a = 3.0;
          double b = 0.3;
          double c = 0.3;
          double d = 0.3;
          double f=c+a+b;
          DecimalFormat df=new DecimalFormat("#.##");
          System.out.println(df.format(f));
          System.out.println(d+c);
this is enougn for u man..
do sme experiment wit it

Similar Messages

  • Can anyone please explain this code to me?

    I am a new (junior)programmer?Can anyone please explain this code to me in lame terms? I am working at a client location and found this code in a project.
    _file name is AtccJndiTemplate.java_
    Why do we use the Context class?
    Why do we use the properties class?
    package org.atcc.common.utils;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    import java.util.logging.Logger;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import org.springframework.jndi.JndiTemplate;
    public class AtccJndiTemplate extends JndiTemplate
      private static Logger logger = Logger.getLogger(AtccJndiTemplate.class.getName());
      private String jndiProperties;
      protected Context createInitialContext()
        throws NamingException
        Context context = null;
        InputStream in = null;
        Properties env = new Properties();
        logger.info("Load JNDI properties from classpath file " + this.jndiProperties);
        try
          in = AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
          env.load(in);
          in.close();
        catch (NullPointerException e) {
          logger.warning("Did not read JNDI properties file, using existing properties");
          env = System.getProperties();
        } catch (IOException e) {
          logger.warning("Caught IOException for file [" + this.jndiProperties + "]");
          throw new NamingException(e.getMessage());
        logger.config("ENV: java.naming.factory.initial = " + env.getProperty
    ("java.naming.factory.initial"));
        logger.config("ENV: java.naming.factory.url.pkgs = " + env.getProperty
    ("java.naming.factory.url.pkgs"));
        logger.info("ENV: java.naming.provider.url = " + env.getProperty
    ("java.naming.provider.url") + " timeout=" + env.getProperty("jnp.timeout"));
        context = new InitialContext(env);
        return context;
      public String getJndiProperties()
        return this.jndiProperties;
      public void setJndiProperties(String jndiProperties)
        this.jndiProperties = jndiProperties;
    }

    Hi,
    JNDI needs some property such as the
    java.naming.factory.initial
    java.naming.provider.url
    which are needed by the
    InitialContext(env);
    where env is a properties object
    Now if you can not find the physical property file on the class path
    by AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
    where the String "jndiProperties" get injected by certain IOC ( inverse of control container ) such as Spring framework
    if not found then it will take the property from the system which will come from the evniromental variables which are set during the application start up i.e through the command line
    java -Djava.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory -Danother=value etc..
    I hope this could help
    Regards,
    Alan Mehio
    London,UK

  • Can anyone please explain this message

    Mac OS X Version 10.4.11 (Build 8S2167)
    2007-12-17 07:27:53 -0500
    2007-12-17 07:27:54.749 HPEventHandler[234]: DebugAssert: Third Party Client: (NULL != m_lock && 0 == errno) Can't create semaphore lock[/Volumes/Development/HP/Mac-Sirani/mac-software/components/HPEventHandler/ Sources/Core/HPTMNotificationManager.cpp:62]
    2007-12-17 07:28:12.455 Translator[275] Invoked to sync conduit com.apple.Safari for entityNames: com.apple.bookmarks.Folder,com.apple.bookmarks.Bookmark
    Waiting for MirrorAgent to launch and respond to CFMessagePortCreateRemote().

    Try reimporting all your media: file>>import>>reimport>>continue

  • Within Music Library can anyone please explain why when I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums?  How can I correct this?  I have tried to 'drag and drop' but that doesn't work.

    Within music Library can anyone please explain why after I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums?  How can I fix this?  I have tried to manually correct by 'drag and drop' individual tracks but that doesn't work.  My music library includes a number of repeat album artwork images simply because not all tracks are being listed under the one album making my library more difficult to use than it should.  Any advise would be appreciated.

    See Grouping tracks into albums.
    tt2

  • I am using elements 10 and only getting audio not video.  Can anyone please explain why? I am a total newbie to video.

    I am using elements 10 and only getting audio not video.  Can anyone please explain why? I am a total newbie to video.

    greenfrogstone
    Just saw your thread, and it looked like a candidate for the Premiere Elements 10 NVIDIA GeForce Roll Back the Driver issue. If your computer uses a NVIDIA GeForce video card/graphics card, then the following applies to you. You do not want to update the driver. Rather you want to roll back the driver version, probably to about May 2013. For your convenience I have done a copy/paste of the forum announcement which gives all the details and fix of the matter.
    Premiere Elements 10 NVIDIA Video Card Driver Roll Back
    If you are a Premiere Elements 10 user whose Windows computer uses a NVIDIA GeForce video card and you are experiencing Premiere Elements 10 display and/or unexplained program behavior, then your first line of troubleshooting needs to be rolling back the video card driver version instead of assuring that it is up to date.
    Since October 2013 to the present, there have been a growing number of reports about display and unexplained workflow glitches specific to the Premiere Elements 10 user whose Windows computer has a NVIDIA GeForce video card. If this applies to you, then the “user to user” remedy is to roll back the NVIDIA GeForce video card driver as far as is necessary to get rid of the problems. The typical driver roll back has gone back as far as March – July 2013 in order to get a working Premiere Elements 10. Neither NVIDIA nor Adobe has taken any corrective action in this regard to date, and none is expected moving forward.
    Since October 2013, the following thread has tried to keep up with the Premiere Elements 10 NVIDIA reports
    http://forums.adobe.com/thread/1317675
    Older NVIDIA GeForce drivers can be found
    http://www.nvidia.com/Download/Find.aspx?lang=en-us
    A February 2014 overview of the situation as well as how to use the older NVIDIA GeForce drivers for the driver roll back can be found
    http://atr935.blogspot.com/2014/02/pe10-nvidia-video-card-roll-back.html
    This matter has been very specific to the Premiere Elements 10 NVIDIA GeForce card user. So, if your computer is using other than a NVIDIA GeForce card, it is likely that the message does not apply to you, and we can then explore other troubleshooting possibities.
    Looking forward to your follow up. Do not hesitate to ask for clarification on anything written here.
    Thanks.
    ATR

  • I still cannot stream YouTube/Netflix/iPlayer etc. on my iPhone 4 via WiFi since updating to iOS 6.0.1....can anyone please solve this for me??

    I posted a couple of days ago about a problem my iPhone 4 was having trying to stream video via WiFi
    Basically, since I upgraded to iOS 6.0.1 I cannot stream YouTube videos via the app or via Safari, Netflix will not work nor will services such as BBC iPlayer.
    I've also discovered this evening I cannot stream any radio apps either.
    All of them will play for 10-30 seconds then stop buffering making them impossible to play.
    I was given several pieces of advice including restoring the phone to factory settings, restoring it as a new phone, hard resetting twice in a row, deleting all the cache/data in Safari but nothing that has been suggessted has solved the problem.
    I know it is not a problem with my internet/WiFi as I have a laptop and a PC both using it and streaming YouTube/raddio stations etc. with no problem. Also, my girlfriend has a 3GS with the old YouTube player and that works with no problems at all.
    Can anyone please help me out as it's getting a bit frustrating not being able to use the streaming function on my iPhone.
    One thing that is odd, I have no problem surfing the web on the phone via WiFi or streaming over 3G. It is only a problem when trying to stream video/audio over WiFi.
    Thanks.

    This is a link to the Apple support page on this issue. Have you tried all of these steps?
    http://support.apple.com/kb/TS1559?viewlocale=en_US&locale=en_US
    Not sure what you mean that you have no signal but are on 3. What are you trying to say?

  • Can anyone please explain these error messages to me?

    Hi,can anyone of you be so kind to explain these warnings during an upgrade to me?
    Thanks.
    WARNING 2005-06-17 16:58:12
    Execution of the command "change 'user' '/install'" finished with return code 1. Output: Install mode does not apply to a Terminal server configured for remote administration.
    WARNING 2005-06-17 16:58:13
    Error 32 (The process cannot access the file because it is being used by another process.
    ) in execution of a 'CopyFile' function, line (359), with parameter (C:\Documents and Settings\ITSadm\Local Settings\Temp\sapinst_exe.5260.1119019920\SYSTEM\librfc32.dll, C:\WINDOWS\system32\librfc32.dll, FALSE).
    WARNING 2005-06-17 16:58:14
    Error 32 (The process cannot access the file because it is being used by another process.
    ) in execution of a 'CopyFile' function, line (359), with parameter (C:\Documents and Settings\ITSadm\Local Settings\Temp\sapinst_exe.5260.1119019920\SYSTEM\librfc32u.dll, C:\WINDOWS\system32\librfc32u.dll, FALSE).
    ERROR 2005-06-17 17:00:50
    FCO-00060  The script block  includes the script block <#1> , but there is no common script block element with that in your control file. Please inform the support team.
    WARNING 2005-06-17 17:06:22
    While copying files to 'D:\usr\sap\PD3\SCS01\exe': source file 'D:\usr\sap\PD3\SYS\exe\run/icudt26.dll' not found.
    WARNING 2005-06-17 17:06:23
    While copying files to 'D:\usr\sap\PD3\JC00\exe': source file 'D:\usr\sap\PD3\SYS\exe\run/icudt26.dll' not found.
    WARNING 2005-06-17 17:06:54
    Error 32 (The process cannot access the file because it is being used by another process.
    ) in execution of a 'CopyFile' function, line (359), with parameter (C:\Program Files\sapinst_instdir\PATCH\ORA\sapmmc.dll, C:\WINDOWS\system32\sapmmc.dll, FALSE).
    WARNING 2005-06-17 17:07:23
    Execution of the command "D:\usr\sap/PD3/JC00/igs/bin/igswd.exe '-version'" finished with return code 1. Output: Version of D:\usr\sap/PD3/JC00/igs/bin/igswd.exe = 6402.0.5.0
    WARNING 2005-06-17 17:07:24
    Execution of the command "C:\Program Files\sapinst_instdir\PATCH\ORA/igstmp/igswd.exe '-version'" finished with return code 1. Output: Version of C:\Program Files\sapinst_instdir\PATCH\ORA/igstmp/igswd.exe = 6403.0.8.0
    WARNING 2005-06-17 17:09:13
    Execution of the command "D:\usr\sap/PD3/JC00/igs/bin/igswd.exe 'D:\usr\sap\PD3\JC00\igs' '-c' '-tracelevel=1' '-recontime=60' '-mux=sgisbruap17,40000' '-listenerhttp=40080' '-portwatcher=40001' '-portwatcher=40002'" finished with return code 1. Output:
    WARNING 2005-06-17 17:29:10
    Execution of the command "D:\usr\sap\PD3\JC00\exe/startsap.exe 'name=PD3' 'nr=00' 'SAPDIAHOST=sgisbruap17'" finished with return code -1. Output: STARTSAP failedDetails are written to C:\Program Files\sapinst_instdir\PATCH\ORA\startPD3.log
    WARNING 2005-06-17 17:30:22
    Execution of the command "C:\j2sdk1.4.2_07/bin/java.exe '-Xmx256M' '-Djava.ext.dirs=D:\usr\sap/PD3/JC00/SDM/program/lib;C:\j2sdk1.4.2_07/jre/lib/ext' '-jar' 'D:\usr\sap/PD3/JC00/SDM/program/bin/SDM.jar' 'undeploy' 'compname=sapjra' 'compvendor=com.sap.mw.jco.jra' 'sdmhome=D:\usr\sap/PD3/JC00/SDM/program' 'logfile=C:\Program Files\sapinst_instdir\PATCH\ORA/callSdmViaSapinst.log'" finished with return code 104. Output: Starting SDM - Software Deployment Manager...tc/SL/SDM/SDM/sap.com/SAP AG/6.4011.00.0000.20050207154237.0000Initializing Network Manager (50017)Checking if another SDM is running on port 50018Processing error. Return code: 104

    This seems to be a common issue on this forum.
    Please take a look at this if you're trying to install via
    Terminal Services:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;320185

  • HT1222 My iPhone 5 keeps saying I don't have enough storage to update software even though I just purchased 15GB of storage. Can anybody please explain this to me? I'm really not tech savvy AT ALL so I don't have a clue what to do :(

    My iPhone keeps telling me I don't have enough space to update my software. But I just bought 15GB of storage, of which 11.7GB is free! So I don't understand. Can anybody please help me? I'm really bad with technology so I don't have a clue.

    Hi Caroline,
    The storage issue you are having is not related to iCloud. The error is telling you that you do not have enough room on your device itself. You need to go to Settings>General>Usage, and under the Storage section at the top, it lists all of your apps and other things taking up room on your device.
    You will have to delete or reduce the size of items on this list in order to free up some room for your update.
    Also, you may want to try the update by hooking up your device to iTunes on the computer you sync with. It does not require as much free memory to update via iTunes as it does OTA.
    Cheers,
    GB

  • Reporting Level - Can someone please explain this attribute?

    All - I am a relative newbie to Siebel on Demand but creating reports with other tools for years. I recently came across some reports that I have inherited that are constantly giving us trouble. They are basic reports that look at the count of calls, meetings, etc. for a given user. What we are finding is that we have used this reporting level attribute to filter but depending on the level of manager logging in it is causing problems. Some people can't see the data and some get a massive amount of duplicated data.
    When it is all said and done we are looking for a simple manager-to-rep list of the counts of these activities. After looking at the reporitng level value it would look like an indicator of relative position from the lowest level in the reports-to heirarchy. We will generally filter for a level = 0 (or maybe 1) in most reports but what I want is a way to control that based on the user. My requirement is to have the level they can see and the detail at one level lower but I dont' fully understand how that gets created or how I can use system variables to find the user's level to control it.
    Anyone that has any background info on this or how I can control a basic anaylytic report in a more maintainable fashion to show my stuff and subtotals at one level lower that would be greatly appreciated.

    Not sure if I can help with the specific report, but I will try to shed some more light on Reporting Level.
    In any report where the Owned By User dimension is exposed, you can find the Reporting Level field. Each user is part of a reporting hierarchy, derived from the "Reports To" value in their user profile.
    The best way to see this is to create a simple report with the User Email, Reporting Level, and Manager Email. This will show you the manager at each level. You can use this to expose and filter on the full management hierarchy.
    Level 0 = the user. All users have a value of themselves as Manager at Level 0.
    Level 1 = Reports To - who the user directly reports to.
    Level 2+ = Up the chain...
    You may want to take a look at some of the pre-built reports to see how this can be used to achieve Team based reports, such as "Team Pipeline Analysis", "Team Sales Effectiveness Analysis", and "Team Activity Analysis". You can open any of the pre-buiilt reports to use as starting points as well.

  • Can anyone please activate this UDID ?? :

    PLEASE PLEASE PLEASE PLEASE PLEASE
    ANYONE CAN ACTIVATE THIS UDID FOR ME ??
    I'LL BE THANKFUL ALL MY LIFE
    I SWEAR I DIDNT KNOW IT REQUEIRES A PURCHASE
    <Edited by Host>

    Join the paid developer program.
    Same to xhevdeti and anybody else who asks.

  • Music in the event browser but it is not working in my video, can someone please explain this to me?

    Hi I've been working on a Mac fir less than a week now and I'm using Final Cut Pro X.
    For some odd reason my music isnt picking up in the timeline correctly, but is showing the audio file in the Event Library.
    There are to Macs where I work and they are copies of each other; so what happens on the one happens on the other. With this in mind  I duplicated the project and copied it onto the other Mac.
    The odd thing about it is that 3 out of the 5 audio clips just dont pick up in the timeline that it is in the event library but you can manually find them there.
    I would just like to know as how you can fix this, as I am working on a small project at the moment and if the project was bigger I would be in searious trouble.

    Please give the exact specifiations of the audio you're talking about? Is it compressed audio? It probably needs to be converted.

  • ITune 7 and video ipod - can someone please explain this?

    Is there any chance that iTunes could somehow be forced to allow uploads of movies and TV shows to the iPod with 1.2 update?
    My real question is, someone above says 1.2 is only for other ipods, not 5g video. Can someone confirm or deny this?
    The current situation here is:
    - iTunes 7 wants to update the iPod software, but when I agree to this, it ejects the ipod and the progress gauge keeps showing indefinitely.
    - If I stop the iposervice, the update fails (of course!) with the 1417 error.
    Multiple times:
    + I have reinstalled iTunes7 twice following all the instructions about deleting temp and iptune directories, etc.
    + I have tried disconnecting and resetting during the original update dialog.
    + I have disabled all services and tried all this again
    The two problems remain:
    iPod not recognized by iTunes 7 (but works perfectly with iTunes 6 so it isn't a hardware or Windows problem).
    Forcing recognition by stopping and starting the ipodservice works, but the upgrade to 1.2 fails.
    I could live with all the above by going back to v6, but
    V6 refuses to upload purchased video content to the iPod without the updated software.
    iPod 5g video   Windows XP Pro   normally a reasonable person

    instead of stopping the ipodservice, try eboncairn's
    does that get you past the 1417?
    I did that. Notice that you don't address my question. I found a way to get things working and I'll post it in a second under a new title because I'm guessing a lot of desperate people will want to try it. First here's the answer I was looking for:
    When IT "suggests" yopu upgrade the 5g to 1.2, the initial gauge comes up for about 40 seconds. Then a dialog comes up and after you deal with that about 1 minute 30 secs will go by.
    Then, the Apple logo will appear on the pod and a guage will show the update loading for about 1 minute.
    Finally there's a reboot of about 20 seconds at which time I came in my^H^H I saw the iPod in the iRuines 7 window.
    I will post all the $**** I had to do to get this working under the title, "IT7 1.2 5g update - worked for me"
    Two days of dicking around to watch a movie I'd already paid for.

  • Can anyone help explain this reoccurring sys log?

    I've tried to track down this event that keeps on repeating so much its making my system log reach almost 60mb! Below is a copy of the log...
    Jun 21 07:14:15 localhost kernel: USBF: 16123.117 IOUSBInterface[0x2fadb00]::handleOpen failing because super::handleOpen failed (someone already has it open)
    ...Do I have some USB device bummin out my system? Such as a USB hub causing a conflict or something? If anyone knows how I can possibly cure or even track down the cause of this reoccurring event, that would be awesome!
    MUCHO THANKS!
    PowerMac G4 1.25GHZ   Mac OS X (10.3.9)  

    R.E.BELL...
    First of all how long has it been that you ran any type of a utility that clears out your System Logs? Yasu (outside link) is my favorite and well named. Tip is to never let your logs get into that 60MB condition.
    As far as the error goes, unless it is choking on it or something isn't working, I would say it is a benign, harmless, or oops! kind of an error.
    ...Ron

  • I have an ipad and have a 'GOOD' app which i think i have to have to download my purchased i tunes. But it wont open in good becasue i need a password/account - can anyone help explain this, and how to access my itunes

    In the past i set up a KNOWCLOUD on a computer which is now defunct.  So, i have all my photos and a few itunes stuck in the scam KNOWCLOUD and have now purchased an ipad and i phone.  When i try to down load my photos it says save to GOOD, but when i open good it says i need to contact my administrator for password and username.  Any suggestions ?

    I have the same problem , i've converted my videos to mp4 , by using different programmes and tried to open them in itunes but it didnt .
    Some people suggested the following although it didnt help me , it might help you
    One suggested to paste the videos that you want in automatically add to itune (  go to your music folder m then click on itunes , then itunes media , and you will find it there )
    Others suggested to o to the ontrol panal , then programmes and features m then lick on quick time (. Or itunes) then Change then repair
    If it didnt help. And you find another method m please let me know
    Thank you

  • I bought a MacBook Pro Retina a few months ago.  I do not understand why I have more than 100 GB of Others in my storage?  Can anyone please explain?

    My MacBook Pro with Retina display suddenly gave me a message when I boot up ie 'Your startup Disk is full'  then after using a few more times, the screen suddenly become frozen white.  Upon getting help, I managed to delete some files but when I checked the Storage space, the largest occupied space was orange color, named 'Others' which is more than 100 GB out of the total 120 GB!!  I am surprised and do not understand what 'Others' mean.  It is definitely not Audio, Video, Pictures, documents etc  It is not mail too.  If anyone can tell me what 'Others' in storage mean and how to see the contents of 'Others' so that I can delete those irrelevant files.  Any advice and guidance is very much appreciated.  Thanking you in anticipation of your early reply.
    Joe

    "Other" includes everything that is not audio, movies, photos, apps and backups.  In other words it includes the OS, mail, documents...  See http://pondini.org/OSX/LionStorage.html and What is "Other" and What Can I Do About It?- Apple Support Communities https://discussions.apple.com/docs/DOC-5142
    To clear disk space see  https://discussions.apple.com/message/24012341#24012341 (in addition to Body's excellent document).

Maybe you are looking for

  • Can't make PDFs from Quark using Acorbat 8

    I am using Quark 9 My acrobat is version 8.0 When I go to "print" to PDF, Quark prints places the file in it's printing cue. It then stops. I click resume printing and it begins to print but then stops and disappears from the cue, never creatign a PD

  • JDBC Communication channel : Error establishing socket

    Dear friends, Im using JDBC comm channel. JDBC driver has been insatlled for SQL Server 2000 (SP3) . However for the JDBC comm. channel i get an error "SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.' following par

  • How do i get an animated wallpaper on my iphone 4

    I have an iPhone 4 and I really want an animated background on my homescreen, not my lock screen, but I don't want to jail break my phone. Does anyone know how to do it?

  • Write to My Documents

    I'm trying to write to My Documents, but I can't figure out how to make it generic. Each pc has at least 2 users on it, I want to write to the My Documents folder for the current user. It works for every other directory except for My Documents Any su

  • After 10.4.7 upgrade, Finder crashes/restarts every ~90sec

    Host Name: ??? Date/Time: 2006-06-28 23:15:47.526 -0700 OS Version: 10.4.7 (Build 8J135) Report Version: 4 Command: Finder Path: /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder Parent: WindowServer [117] Version: 10.4.6 (10.4.6) Build V