Question about double

hi everyone.
double i = 2.0;
double j = 1.1;          
double result = i - j;
System.out.println("i - j = " + result);Regarding upside code, the result was expressed 0.8999999999999.
But I think that the result is 0.9.
Could you explain about this?

Search these forums and you will find this topic discussed and answered many times.
Read this: http://docs.sun.com/source/806-3568/ncg_goldberg.html
Floating point is stored as a binary floating point number and, just as not all numbers can be expressed exactly in decimal (1/3 for example), not all numbers can be expressed in binary exactly.

Similar Messages

  • Question about double tap on lumia 720

    Hello, i wanna ask about double tap in lumia 720. It will be maybe in future this setting?

    not likely, unless they use compatible hardware on new 720 phones, or they change the hardware of old 720s
    The silence will fall

  • Simple question about double

    I've a routine in which I have to some operations like
    double z = x ^ y;
    where x and y could be very high value and the result z can go out upper the double range and I have as result "infinity"
    to which kind of type do you suggest me to substitute the double type?
    and, is there a way to catch an exception when the result is "infinity" and not a common double number?
    thank you very much.

    I've both large value and very tiny values close to 0.
    I cannot rethink about the problem because it is simply an algorithm that executes a mathematical method, and these are the coefficients that are inserted into a linear system that after I need to solve.
    The critical part is the generation of the coefficients of that linear system, and the solution of the linear system, but the results of the linear system usually doesn't give range problems.
    I know that double is 64 bit, with 128 bit I would not have any kind of problem..
    The range of the values depends from the input parameters given by the user, if the user enters quite big values as a parameter, maybe during the elaboration the double will be not enough.
    About BigDecimal, if it can work in a way similar to a 128 bit size double it will be ok.

  • A question about double install lightroom 5

    I have a lightroom 5 license on CD and installed on my stationary computer. Is it true that I can install it on my laptop too? I want to use lightroom on vacation.

    Is ittrue that Ican installit on mylaptoptoo?
    Yes

  • Question about double pulls

    Revelate wrote:
    If you haven't already, sign up on a freebie from one of the numerous TU-pulling report services, even Credit Karma is good enough for what you need among other options. Monitoring solutions can be delayed unfortunately.I have the latest. I get fresh pulls ever night and also use back doors. TU is habitually delayed.

    ceejx wrote:
    Revelate wrote:
    ceejx wrote:
    Revelate wrote:
    If you haven't already, sign up on a freebie from one of the numerous TU-pulling report services, even Credit Karma is good enough for what you need among other options. Monitoring solutions can be delayed unfortunately.I have the latest. I get fresh pulls ever night and also use back doors. TU is habitually delayed.Yeah, TU is slow, that sucks.  Out of curiosity mind sharing why you need to go right now? Fortunately for me outside of mortgage shopping, I have to go out of my way to get anyone to look at my TU report.Looking to BT to the 0% interest slate. Longer it takes, more interest I pay. 2 weeks can cost me $$. But also just want to know the process.TU isn't usually 2 weeks behind for me, 5 days isn't unusual in my experience though unfortunately... and of course the date of last activity is when the lender reported and matches both EQ/EX, so yeah it's just TU being lame.

  • Follow-up on question about copying 10.4

    I only got one reply to my question about how to copy OS 10.4 from one internal drive to another and unfortunately, the response was cut short. Something about if I had another computer with Firewire, using it and that's as far as the response went. Yes, I have a  laptop and have Firewire, but still don't know how to use it to help.

    If you just wish to make a duplicate of one hard drive to another hard drive in the same G5, then do this:
    Clone using Restore Option of Disk Utility
    Open Disk Utility from the Utilities folder.
    Select the destination volume from the left side list.
    Click on the Restore tab in the DU main window.
    Check the box labeled Erase destination.
    Select the destination volume from the left side list and drag it to the Destination entry field.
    Select the source volume from the left side list and drag it to the Source entry field.
    Double-check you got it right, then click on the Restore button.
    Destination means the second internal drive. Source means the internal startup drive.

  • Question about the Documentat​ion Tags for Source Code

    Hello,
    I have a question about CVI's automatic source code documentation. My problem is that is seems like you need to write all documentation for a specific tag on one line. If you don't, a line break will be inserted when the documentation is displayed. Suppose I want to write a large amount of documentation for the function itself, using the HIFN tag. If I don't want linebreaks to be forced in the documentation, I need to write all this documentation on one single line, which kinda messes up my code. If I split the documentation over several HIFN tags, the documentation displayed to the user might look messed up because of all the linebreaks. Is there any escape character I can put at the end of a line, allowing me to split the documentation of several HIFN lines without forcing linebreaks in the documentation?
    Thanks!
    GEMIDIS - Innovating Display Technology
    HQ Ghent, Belgium

    This information is certainly useful. Note, however, that it can also be found in the documentation
    Tag
    Description
    /// HIFN help text
    Specifies the help text for the function. Use multiple /// HIFN tags to display help text for the function on separate lines. To separate help text with an empty line, use /// HIFN on a line by itself. You also can use HTML tags, but you must enclose the tags in <HTML><BODY></BODY></HTML> tags.
    Example
    /// HIFN SampleFunction returns the value of a control.
    int SampleFunction (int controlID, ctrlType controlType, char label[], double *value)
         SomeAction;

  • Some questions about importing HTML files

    Hi, folks
    Let's suppose we want to import a pack of HTML files formatted in HTML5 wit's it's CSS into a double-oriented folio. A couple or three questions about that, please:
    1. Is there a limit for a reasonable quantity of HTML files I can import into a folio? I mean.. 100 would be way too much, for instance?
    2. These HTML files could be navigated and referenced from inside TOC-pages made in InDesign,right? (navto://..., I gues?)
    2. Will it be possible, by means of HTML adaptative design techniques, to treat both orientations (vertical and horizontal) as different viewports or screen sizes so that the design adapts for instance the column width with its CSS?
    3. That said, will the InDesign final app. respect that adaptative CSS rules?
    I am asking this because we are looking for a way to inject big quantities of content with a very similar design into our application in a really fast and automatizable way and I have the suspicion* that importing HTML5 preformated CSS files could be the a very good and simple alternative to importing XML into InDesign templates as we start out content as tagged almost-html files.
    Thanks a lot
    Gustavo Sánchez (Posting from Madrid)

    I assume you are asking about using HTML articles.
    1. There is no limit beyond simply keeping things reasonable.
    2. Yes. Just use navto://articlename
    3. Yes. I've used min-width of 768 and max width of 1024 to control it.
    4. InDesign does not enter into any of this with the exception of using the folio builder panel. Everything else is done in Dreamweaver or whatever program you decide to use for the article.
    If you want to restrict the HTML articles to one orientation or the other, use the _h and _v suffixes.
    Bob

  • Questions about OLE containers

    Hello,
    I try to use an OLE container for save any type of documents, the majority are Microsoft Word (*.doc), Acrobat Reader (*.pdf) and images (*.jpeg, *.jpg, *.bmp, ...)
    I prove to insert a document an save it in the database and all works fine. The document is saved in a BLOB column, and if I try to activate the OLE container I view the document correctly, but I have questions about OLE container:
    1.- Once I saved the document into the database (the icon of the document is shown into the OLE container), if I query the database to retrieve the documents, the OLE container not shown the icon of the document, and if I try to activate the OLE container, making double-click, it doesn't make anything.
    I think that the query to the database don't retrieve correctly the documents into the OLE container.
    2.- Once I saved the document into the database (the icon of the document is shown into the OLE container), if I try to activate the OLE container, depend the document I need to do twice double-click to open the document.
    If I try to open a Word document (*.doc) it need one double-click to activate, but if I try to open an Acrobat document (*.pdf) it need twice double-click to activate.
    Why? How can I open any type of documents with one double-click?
    3.- The form that I develop will work in client-server and in web mode.
    The problem is that if I try to run the form into web mode with OLE container, I have an error:
    "FRM-92100: Se ha interrumpido la conexión con el Servidor. Puede ser el resultado de un error de red o fallo en el Servidor. Debe reestablecer la conexión", and if I click in Details I have "Java Exception: java.lang.ArrayIndexOutOfBoundsException ...".
    If I delete the OLE item, it works fine, and I don't have any errors.
    I know that OLE container doesn't works in web mode, because this I will develop this functionality with JavaBean, but I would like that in client-server mode works with OLE container.
    There are any way to do this, that in web mode doesn't has this error, and in client-server mode works with OLE container?
    Thank you very much
    Jordi

    2. If you use Time Machine you can't browse those pictures on the Movable DIsk. It's not designed to work like that.
    3. Don't use copy and paste, try drag and drop instead.
    You don't tell us how you are managing these photos. I suggest that you use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the everything. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store

  • Question About Color's and Gradients

    Hi all,
    I have a question about color swatches and gradients.
    I am curious to know, if I have 2 color swatches that I make into a gradient color, is it posible to change the tint of each indivdual color in that gradient and have that applied to the gradient without having to adjust the gradients opacity.
    The reason that I'm asking this is because in creating a project I found that the colors that I chose for to make my gradient from my swatches were to dark, and while I can adjust each one's tint to my liking (if the object they were applied to was going to be a solid color) but that doesn't seem to apply to the overall gradient.
    I hope that makes sense, I know that this was something that was able to be accomplished in quark and was wondering if I can do something similar.

    If you double click your gradient swatch (after adding it to the swatches)
    Then click a colour stop in the gradient, and then change the drop down menu to CMYK (or rgb)
    And you can alter the percentages there. It's not much use for spot colours but it's a start.
    But making tint swatches would be a good start anyway.
    At least then when you double click the gradient (in the swatches) to edit it you can choose from CMYK, RGB, LAB, or Swatches and adjust each colour stop to your liking.

  • Questions about use of InfoObjects

    Hi,
    I am generating profiles uisng the ODSs, and i have a question about the mapping:
    For IO 0TCTNIOBJNM, I am mapping it to 0HIER_NODE for text node .
    What should these be mapped to? What are these supposed to be?
    0TCTIOBJNM
    0TCTNODE
    Thanks
    Will

    Thanks so much for the reply.
    Before I posted my code, I double-checked my syntax and think I found the problem. I using Fragments at the beginning of my page, and at the end, to construct a wrapper table where I can put some fancier graphics, etc. I'm using the fragments and plain old HTML because using another gridpanel on each page is a bit cumbersome, and also I need the flexibility of possibly doing some dynamic things to this table... Because each fragment doesn't have matching tags to complete the page, I think that's screwing up the designer, as you suggested. For instance, here is my fragment at the top of each page :
    <TABLE WIDTH="100%" BORDER="1">
    <TR>
    <TD ALIGN="CENTER" VALIGN="TOP">
    <TABLE WIDTH="595" BORDER="2" CELLSPACING="0" CELLPADDING="0" BORDERCOLOR="#184266">
    <TR>
    <TD WIDTH="50%" ALIGN="LEFT" BGCOLOR="#184266"> </TD>
    <TD WIDTH="50%" ALIGN="RIGHT" BGCOLOR="#184266"> </TD>
    </TR>
    <TR>
    <TD COLSPAN="2" ALIGN="CENTER" VALIGN="TOP">
    <!-- WIZARD GRID BEGINS HERE -->
    Any suggestions on a better way to use includes to break out some necessary HTML??
    THANKS very much!
    Tom

  • Questions about the content of download meeting recording .zip file

    I tried posting this on the resurrected Connect forum, but my Adobe ID wasn't recognized there....
    Concerning the files that are included in the .zip file of the meeting recording that can be downloaded:
    1) Is there any documentation describing the files and their contents (i.e. what each file represents, what each XML element and attribute in those files represent)
    2) Are there any files that capture mouse movement on a shared desktop?
    Thank you!

    Hi Sean,
    Regarding your first post:
    Thanks Jorma! I don't have access to an FMS build at the moment but I'm quite certain it's there. As for contacting Jaydeep, I am 90% sure he authorized us to broadcast his email on here if folks had questions about the tool, but, in the case that I'm wrong and he didn't - I'm going to double-check first.
    Regarding your most recent post..
    "To be clear, the most critical goal I'm trying to accomplish is to create an automated process that will download the recording meeting at its highest quality in a consistent and reliable manner".
    I personally believe this is possible; unfortunately, I haven't seen it done yet. If your recording contains:
    - audio
    - a camera feed
    - screensharing
    Then I think you might be able to get this going. If it contains shared content, like a shared PPT, this gets trickier.
    "To do this, of course, I have to reproduce some of the functionality that Connect provides, starting and combining video and audio streams according to the instructions in the control files."
    Exactly right. If your recording didn't contain shared content, then all you've got on your hands are a bunch of audio/video files that you could edit together as you wanted with your favourite video editing tool. If it contains shared content, here's (at a high level) what's happening.
    For shared PPTs or FTContent files:
    First (for version 9 recordings only), Connect reads the information on the Shared Content's location and SCO within mainstream and indexstream and validates it before loading it. I don't recall this happening to the same extent with version 8 or earlier, but maybe it was. Now, if the content is validated (ie. Connect can find it) the share pod will display as black, if it doesn't, you get an empty pod with an message like "No content is being shared" or something like that.
    Connect then looks at the actual FTContent file, and loads the content that is to be shared using the file path and sco ID listed in here. It's important to note that the SCO ID and file path in here will likely not be the same as the original file you uploaded to your room, it's a new SCO id (I believe SCOs of this type are called referenced scos) and new path.
    Now...if I was going to build some sort of player which would play all these files in one screen to make a recording...I might not want to use Connect's code here. If you know the file path to the shared content (from FTContent), you could easily view it with the content URL (conveniently also in FtContent). I'm not a coder, but I'm envisioning something like Presenter's GUI where you've got the presentation's content in the main area, and a video file (if there is one) playing back on the side.
    Anyways, food for thought if you want to try to go about this. Connect recordings are incredibly complex and they come with a big learning curve, but if you can make sense of them the knowledge is quite valuable.

  • Question about the function module (RFC_READ_TABLE)

    Dear everyone
    Could I ask you a question about the function module (RFC_READ_TABLE)?
    I was asked if it's possible to create a report which compares the data between different SAP systems (both production systems).
    Now, the easiest way would be to use the function module (RFC_READ_TABLE) within a SAP infoset query (SQ01 type query).
    But I heard the rumor that using the function module (RFC_READ_TABLE) is not advisable due to the security reason.
    However, I am not exactly sure what sort of security problems this function module can possibly have...
    Would you help me on this?
    I also would like to know if using "remote enabled module" type function module can always overcome this possible security issue.
    Or, are there any points that I need to be careful about even when I use "remote enabled module" function module?
    Thank you very much in advance.
    Takashi

    Dear Fred-san
    Thank you very much for your support on this.
    But, may I double check about what you mentioned above?
    So, what you were mentioning was that if some user executes the query with
    the function module (RFC_READ_TABLE), under the following conditions, he can access to
    the HR data even when he does not have the authorizations for HR transactions?
    <Conditions>
    1. the user has the authorization for HR database tables themselves
    2. RFC_READ_TABLE is called to retrieve the data from HR database
    <example>
    Data: LF_HR_TABLE like  DD02L-TABNAME value 'PA0000'.
    CALL FUNCTION 'RFC_READ_TABLE'
       EXPORTING
        query_table                = LF_HR_TABLE
      TABLES
       OPTIONS                    =
       fields                     =
       data                       =    .
    But then, as long as we call this function module for a non-critical tables such as
    VBAP (sales order) or EKKO (purchase order) within our query, it wouldn't seem to be
    so security risk to use RFC_READ_TABLE...
    Besides, each query (infoset query) has got the concept of user groups, which limits
    the access to the queries within the user group.
    ※If someone does not belong to the user group, he cannot execute the queries within that
       user group, etc
    So, my feeling is that even infoset queries does have authorization concept...
    Would you give me your thought on this?
    I also thank you for your information for SCU0.
    That is an interesting transaction
    Kind regards,
    Takashi

  • Question about Runtime.exec

    Rob,
    Thanks for your help.
    I asked a question about a weird Exception on Nov 14, and you told me that I am
    using Runtime.exec to start an external process, and that process is crashing.
    I am a green-hand on Weblogic, and I am trying to enhancing a project developped
    by another person, so I am not familiar with some concepts yet.
    Could you please give me some simple explanation about Runtime.exec and external
    process?
    I found two methods that uses "Runtime" from two classes as following, could you
    help me to see whether or not there is something wrong with the usage of Runtime?
    Thank you very much.
    private int runShellCommand(String command) {
    int exitVal = -1;
    try {
    File runDir = new File(runDirectory);
    String[] env = new String[0];
    Runtime rt = Runtime.getRuntime();
                   double start = System.currentTimeMillis();
    Process proc = rt.exec(command, env, runDir);
    // Capture output in separate thread
    ThreadedStreamReader error = new ThreadedStreamReader(proc.getErrorStream(),
    "ERROR");
    ThreadedStreamReader output = new ThreadedStreamReader(proc.getInputStream(),
    "OUTPUT");
    error.start();
    output.start();
    exitVal = proc.waitFor();
    if (logger.isDebugEnabled()) {
         double runtime = (System.currentTimeMillis() - start) / 1000.0;
         logger.info("run " + runId + " " + command + " finished in " + runtime
    + " seconds");
    } catch (IOException e) {
    logger.fatal("DOE-2 failed \n" + e.getMessage());
    } catch (InterruptedException e) {
    e.printStackTrace();
    return exitVal;
    public static void main(String[] args) throws Exception, InterruptedException
    final Doe2MessageServer server = new Doe2MessageServer();
    while(!connected) {
    Thread.sleep(1000);
    logger.info("Attempting to start JMS service ...");
                   try {
              server.init();
                   } catch (Exception ex) {
    // shutdown hook to close JMS connection
    Runtime.getRuntime().addShutdownHook(
    new Thread() {
    public void run() {
    server.finalize();
    server.receiveMessage();

    Runtime.exec is a J2SE API. It's not really specific to WLS.
    You can read about it here:
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runtime.html
    It looks like you are starting a JMS Server in a separate process and
    that process is crashing.
    (You could of course just use WLS's JMS Server instead :>)
    -- Rob
    Iris Qu wrote:
    Rob,
    Thanks for your help.
    I asked a question about a weird Exception on Nov 14, and you told me that I am
    using Runtime.exec to start an external process, and that process is crashing.
    I am a green-hand on Weblogic, and I am trying to enhancing a project developped
    by another person, so I am not familiar with some concepts yet.
    Could you please give me some simple explanation about Runtime.exec and external
    process?
    I found two methods that uses "Runtime" from two classes as following, could you
    help me to see whether or not there is something wrong with the usage of Runtime?
    Thank you very much.
    private int runShellCommand(String command) {
    int exitVal = -1;
    try {
    File runDir = new File(runDirectory);
    String[] env = new String[0];
    Runtime rt = Runtime.getRuntime();
                   double start = System.currentTimeMillis();
    Process proc = rt.exec(command, env, runDir);
    // Capture output in separate thread
    ThreadedStreamReader error = new ThreadedStreamReader(proc.getErrorStream(),
    "ERROR");
    ThreadedStreamReader output = new ThreadedStreamReader(proc.getInputStream(),
    "OUTPUT");
    error.start();
    output.start();
    exitVal = proc.waitFor();
    if (logger.isDebugEnabled()) {
         double runtime = (System.currentTimeMillis() - start) / 1000.0;
         logger.info("run " + runId + " " + command + " finished in " + runtime
    + " seconds");
    } catch (IOException e) {
    logger.fatal("DOE-2 failed \n" + e.getMessage());
    } catch (InterruptedException e) {
    e.printStackTrace();
    return exitVal;
    public static void main(String[] args) throws Exception, InterruptedException
    final Doe2MessageServer server = new Doe2MessageServer();
    while(!connected) {
    Thread.sleep(1000);
    logger.info("Attempting to start JMS service ...");
                   try {
              server.init();
                   } catch (Exception ex) {
    // shutdown hook to close JMS connection
    Runtime.getRuntime().addShutdownHook(
    new Thread() {
    public void run() {
    server.finalize();
    server.receiveMessage();

  • Question about changing values of a total by selecting a check box.

    OK, so what I did was create a form for my workplace that totals the value an employee's quality of work. what i want this form to do is: In one cell the total is a 100 point value. In one column i have a markable checkbox and in the column next to that there is a point value for that particular category. what i want is to be able to check a box next to category and have the corresponding point value deducted from the "100" total. for example if I check the box next a value of 40, then the 100 becomes a 60 automatically. I am new to numbers, and any spreadsheet app for that matter so any help would be greatly appreciated.

    Tommyboy29 wrote:
    Another question about my last post: numbers will only let me add 2 to 3 cells in the formula to change the "total" number of 100. is there a way to add more then 3 cells? i have 9 cells total that i want to have the ability to subtract from that same total?
    There is no such limit in Numbers. I'm guessing that you ran out of room in the formula edit line in the Formula Bar.
    Grab the double line and pull it down to expand the edit area.
    Jerry

Maybe you are looking for