What is Double.NaN for?

I'm trying to understand what is Double.NaN for. I did understand the use od Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY. I did try
double value = Double.parseDouble("123ws34");
and then
if (value == Double.NaN)

NaN (not a number) is returned by various methods when the result from a function is undefined. You can use this fact to code a reasonable action when the program does something silly - like dividing zero by zero.

Similar Messages

  • What is  Double.NaN

    hi i want to know what is Double.NaN ?
    the SUN doc says, "....... A constant holding a Not-a-Number (NaN) value of type double...." then what is the content of Double.NaN ?
    suppose i am writing Double a = new Double(Double.NaN); what is the content of a ?
    i want an example of Double.NaN ? can you give one example of what does that mean ?

    It is a value that is the result of certain arithmetic
    operations, such as multiplying infinity by zero or
    dividing infinity by infinity. ok...i am not doing any illegal arithmetic operation below. how about the code ?
    public class Base
            public static void main(String args[])
            Double a = new Double(Double.NaN);
        Double b = new Double(Double.NaN);
        System.out.println(a.NaN); // trying to see what is the  default of Nan field
        System.out.println(b.NaN); // trying to see what is the  default of Nan field
        if( Double.NaN == Double.NaN )  // line 1
           System.out.println("True");
        else
           System.out.println("False");
        if( a.equals(b) ) // line 2
          System.out.println("True");
        else
          System.out.println("False");
       i am getting output
    NaN
    NaN
    False
    True
    Press any key to continue...
    that means default of NaN field is a NaN. look //line 1 . if both of them gets default value NaN then why not the output is true ?
    and also look at line 2 . both of them have contents NaN. why why not the output is true here also.
    so , the output should have been
    NaN
    NaN
    true
    true
    but it is not.
    where is the mistake ?

  • HT204088 What do I do if I think I've been double-billed for an in-app purchase?

    What do I do if I think I've been double-billed for an in-app purchase?

    The necessary links/menus you need to navigate to after clicking the Report a Problem link can be a little tricky to find. See
    Refunds from the App Store or iTunes Store
    Hope it works out for you (:

  • TS1702 I was double billed for an app. What do I do?

    I was double billed for an in-app purchased  They say it's in eligible for a refund.  Now what?

    http://www.apple.com/support/itunes/contact/

  • What do you do when you get double-billed for in-app purchases?

    I am getting consistently double billed for in app purchases I have done for the Candy Crush Saga and Panda Jam.  Who do I contact to discuss this issue?  Doesn't iTunes have any responsibility for apps they are offering for sale on their store??

    Apple does not police the apps unless there are serious problems with them and many complaints.
    Contact iTunes support staff who have access to your account at: http://www.apple.com/emea/support/itunes/contact.html for help.

  • Strange behaviour of Double.NaN

    I have a question, which is purely for my own interest as I've read the documentation and know that when checking for a doulbe being "Not a Number" you should use Double.isNan() and not double== Double.NaN.
    However,
    I'm confused as to how this works. If you look inside the Double Class, you will see that Double.NaN is defined as a static final - i.e. a constant.
    Now the following code:
    if(Double.NaN == Double.NaN) will always return false. But should the compiler optimise this and realise the result is true? After all its just a static final like any other constant.
    Secondly, the inplementation of Double.isNan(double d) is as follows:
    static public boolean isNaN(double v) {
         return (v != v);
    }Again, when this was compiled, shouldn't the compiler just optimize it and realise the result is always false?
    If anyone can shed light on this I would be most interested!
    Thanks

    erm...wrong again.
    consider the following code:
    public static final double a = 1.0;
    public static final double NaN = 0.0d/0;
    if(a!=a) System.out.println("This is wierd");
    if(NaN!=NaN) System.out.println("This is wierder");
    No, not wrong again.
    Your question was specific to Double.NaN, and like you said yourself, and like this code demonstrates, Double.NaN != Double.NaN
    The result is that only the second print statement
    appears. How my question is, they are both just
    constants, not evaluated dynamically at runtime but
    fixed at compile time. So how does it work?I fail to see the problem. Yes, Double.NaN is a compile-time constant. So what? I fail to see how that should make any difference.
    The == operator always gives false when one or both of its arguments is Double.NaN. What does it matter how it works - the actual implementation of it will be different from one compiler and JVM to another - you shouldn't really care how it works - you just need to know that it is defined to work that way.

  • What is the alternative for DisplayMemberPath="Value" for Windows Store applications?

    I think there is a bug with Windows Store Applications when it comes to using DisplayMemberPath="Value".
    Here is my code
    <ComboBox Height="40" VerticalAlignment="Stretch" SelectedValuePath="Key" DisplayMemberPath="Value" x:Name="comboBox1" FontSize="25"/>
    var source = new Dictionary<string, double>();
    source.Add("Item1", 0.4);
    source.Add("Item2", 0.3);
    source.Add("Item3", 0.1);
    source.Add("Item4", 0.1);
    var formateDSource = new Dictionary<string, string>();
    foreach (var item in source)
    formateDSource.Add(string.Format("[{0}, {1}]", item.Key, item.Value), item.Key);
    comboBox1.ItemsSource = source;
    If you use this code in WPF in works perfectly. However if you use this code in a Windows Store Application then the Combo Box is empty and an error is thrown. So is there an alternative way to do this in Windows Store Applications and have I unearthed a
    bug? Because I have researched the Web for days and found no solution to this.*please do not comment unless you have tried my code as a Windows Store App not a WPF in Visual Studios. Can Someone post an example based on my code that works in Windows Store
    Apps please because this is terrible.
    Thanks

    It looks like you got an answer on SO:
    http://stackoverflow.com/questions/29817124/what-is-the-alternative-for-displaymemberpath-value-for-windows-store-applicat
    This does look like a bug.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • I have an apple iphone4 im facing the problem that my phone senser is not working when i rotate the phone in videos or music play there is working from the senser can u tell me what can i do for this....

    i have an apple iphone4 im facing the problem that my phone senser is not working when i rotate the phone in videos or music play there is working from the senser can u tell me what can i do for this....

    If you double tap the home button, and then swipe your finger to the right, make sure you DO NOT have the Lock Orientation button enabled.
    You know it is disabled if there is no padlock in the middle of the icon.

  • Double space for period. How about comma, too?

    It's already kosher with the interface guidelines to
    double space at the end of a sentence to get a
    period, so how do I get people on the bandwagon
    to make the spacebar a dual- or tri-function spacebar:
    double tap for a comma, period, or question mark:
    |   ,   |   .   |   ?   | <-----spacebar with
    -----------------------           punct zones
    Double-tap at the left edge for comma space, double-tap
    near the middle for period space, and at the right edge
    for question mark space. Why have to go to a separate
    screen to type a comman and then come back to the text
    keyboard? That's inifficient.
    Comma, period, and question mark. That hits most of the major
    marks used. Yeah, there's the exclamation point, but the
    real estate on the spacebar reliably handles only three
    marks. Four may be hard to employ, but I may be wrong.
    I suggested this to Apple two years ago, and nothing's
    been added to the OS.
    Comments?
    Doug Parker
    Orlando, FL

    Firstly, when I said InDesign inflates the space I didn't mean it whacked in a great chunk of space. It just gives a little bit more air relative to the fit of the text around it. You may not always see any noticeable difference. But when I read a book I don't want to see obvious white spaces at the start of every sentence. As long as the full point and following capital letter register on my brain fast enough that I am reading a new sentence, that's good enough for me. I think it makes reading more fluid. If you want to see extra space at the start of a sentence, then it's probably best to carry on with your double spacebar - unless you want to try something more exotic like a fixed width space.
    I didn't mean you to literally type <full point><space><any character> into the find. I was just trying to tell you what to input. Type the full point, hit the spacebar, and then use the options list to the right of the find field (shown as a @), select "Wildcards", then select "any character". What you should see in your find field is . ^?
    You could then enter .  ^?      - that's two spaces. See why I spelled it out as <space>? -  into the change to field.
    k

  • Double Points for New Games?

    I've been a Gamer's Club member for nearly a year now, and I've never seen the double points for any of my gaming purchases.  Is there something else that I need to do to 'activate' this promotion, or is it just a glitch?
    Do double points only happen when you purchase games for your 'preferred' system?

    Hi house1548,
    I'm very sorry to hear that our Gamers Club has only been half as awesome as it should have been for you since joining.  I can imagine this has been a surprise to learn, and I want to get to the bottom of it with you!
    I have reviewed your account, and everything appears to be in order, so I am not sure what may be causing the discrepancy.  I have reached out to our partners on the My Best Buy team for further research, and as soon as I have more information for you I will let you know via a private message.
    Thank you for being a My Best Buy member, and thank you for visiting our forum.
    Best regards,
    Mike|Social Media Specialist | Best Buy® Corporate
     Private Message

  • When I transferred my iPhoto from macbook to iMac it created double events for each, how do I correct this?

    When I transferred my iPhoto from macbook to iMac it created double events for each, how do I correct this?

    How did you do it?
    Here's what should work:
    To move an iPhoto Library to a new machine:
    Link the two Macs together: there are several ways to do this: Wireless Network,Firewire Target Disk Mode, Ethernet, or even just copy the Library to an external HD and then on to the new machine...
    But however you do choose to link the two machines...
    Simply copy the iPhoto Library from the Pictures Folder on the old Machine to the Pictures Folder on the new Machine.
    Then launch iPhoto. That's it.
    This moves photos, events, albums, books, keywords, slideshows and everything else.

  • What are the steps for using the backup files to reload data to my blackberry curve (8310, i think)?

    What are the steps for using the backup files to reload data to my blackberry curve (8310, i think)?

    Connect BB to PC. On 'Desktop Manager'>Backup & Restore tab>Click Restore. Double click .ipd file (backup file created from Desktop Manager).

  • On my new iPAD2, when I tap an icon for a long time it doesn't flick. What can I do for that?

    On my new iPAD2, when I tap an appls icon for a long time it doesn't flick. What con I do for that.

    Try this and see if it helps.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Or....
    Quit all apps and restart the iPad. Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button. Restart the iPad.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.

  • What is posting key for debit note and credit note?

    Hi Gurus,
    May I know what is posting key for debit and credit note?
    My current sales debit and credit note having same posting key.  Where can I set this posting key?
    Sales debit note                dt      cr
    Sales credit note               dt      cr
    Customer debit note          dt      cr
    Customer credit note         dt      cr
    Vendor debit note             dt      cr
    Vendor credit note            dt      cr
    Thanks
    Moderator: Please, avoid asking basic questions. Try to search available SAP material first

    This depends on requirement.
    Generally, SAP std are followed and ought to be followed, as Std config are based on best practices world over.
    Still, if you business process requires then take an example,
    - use TCode OBYC,
    - double click on transaction BSD - Inventory posting
    - provide chart of account, if asked.
    - check the posting keys for transaction by clicking Posting Key button on the Maintain FI Configuration: Automatic Posting - Accounts screen.
    In Debit
    89 - Stock inwrd movement
    In Credit
    99 - Stock outwd movement
    Thanks & Regards
    JP

  • WCS annual support: what do I get for extra AP license packs?

    I am not trying to be snide here, but I am having a difficult time understanding what new value I get for an extra SAU annual support package that my Cisco Partner says I now need, since I added additional AP licenses to the WCS software. This add-on SAU will more than double my annual support costs for the WCS software. I've called and emailed my partner several times on this, and basically it came down to "that's how Cisco does it now." I've also done on-line chat and a couple hours of phone  time with Cisco's pre-sales support, and technical support, but neither of them was able to give me any answer, and after passing me back and forth between their two divisions, they passed the buck back to my Cisco partner.
    But, my question remains: What additional value do I get for this doubled price "Software Application support with Updates"? I can already download WCS software and WLC firmware. The only thing that has changed is my software's AP limit.
    We've had WCS 5.0, with the original Base 50 AP license. The WCS server runs two WLC 4402 units, one set for 25 APs, and one for 50. We actually have 46 APs deployed. We've paid annual support since we first purchased this system, SAU software and upgrade support for the WCS software, and SmartNet hardware support for the WLCs. We have not had support for our actual AP hardware, as our partner recommended just buying spares instead, as a cheaper option. But, AP firmware updates come automagically with the WLC firmware updates.
    We will soon be going beyond 50 APs, so we installed an 100 AP add-on license for the WCS. This changed the "About" box for the WCS software so it now says it is licensed for 150 permanent APs, instead of the original 50. (This add-on license cost more than $4,000, so I don't feel that I'm trying to get a bigger WCS system without paying for it.)
    Recently I upgraded my WCS software to v5.2 and then to v6, and am currently at 6.0.196.0. I also upgraded my WLC firmware, which updated my APs. Everything seems to be working well, and these updates were all included in my basic SAU for WCS, which runs about $720 per year.
    However, March is when our SmartNet renewals come due, and my partner says we now need to buy a second version of WCS SAU, supposedly a requirement with our additional 100 AP license. This add-on support ( part "CON-SAU-WLB100EX" ) goes for $1,080 per year, so my WCS annual support would now be $1,800 instead of $720.
    As I said, I really don't understand what I'm getting for this additional money. We are a small enough college that I can't spend $1000 without justifying the expense. Already, with my existing WLC SmartNet payment I get firmware updates for my WLC and AP hardware, and with my existing WCS SAU payment I get software updates on the server. None of this seems to have changed with the additional AP license count.
    (Note that although the WCS update package allows 100 more APs, my present WLC hardware really only allows an additional 25 APs.)
    If nothing else, for $1,000 a year, Cisco should be able to give me a pithy explanation of what I am buying :-)
    In summary:
    What does CON-SAU-WLB100EX actually support? Why do I need it?
    What happens if I keep paying my CON-SAU-WCS support and my WLC support, but do not add this new charge? Is my WCS software still upgradeable?
    Thanks for any insights you can provide,
    Steve Bohrer

    I'm not selling support contracts, I just work in TAC. But here's my 2 cents :
    If you have your license for your extra APs (which you said you already bought), your WCS will run just fine.
    With regards to software download, either you have download access or you don't. The system can't prevent you to download WCS because it saw you had purchased more AP license than your support contract mentions. So download should still work in the future.
    From a TAC perspective, if there is a support contract, we give support. We don't care at all how many APs people have.
    So all considered, I have no idea what this extra support contract will bring you :-)
    But since the Sales people in your region don't seem to gifted in explaining what they are selling, I would just go without that special contract unless they justify what it exactly adds and what you will lose if you don't take it. Probably if you don't say a word, they won't notice anything and will still support you nonetheless :-)

Maybe you are looking for

  • Two Iphones on one itunes account?

    i have just upgraded to an i phone 4 but also want to keep my iphone 3 in my itunes too, can i set up the account so both phones run off itunes but can have different apps etc on?

  • How can i see what content is stored in the cloud?

    I have a huge volume of content stored in the cloud...I don't know what it might be....I'd like to be able to see it and clean it up...it may be years of old mail or who knows. How can I see it and clean it up?

  • How to determine the logical Keys of logical fact table in BMM layer?

    Hello guys I'd like to know more about how to know what columns of the logical fact table should be used as key in BMM layer. How OBIEE behaving differently when different keys are selected? In my situation, I have 1 fact table that physically joins

  • Is Iphone 6 compatible with LTE bandwith in UK?

    if I buy an apple iphone 6 16gb with tmobile without contract, what is the model of the celluar ( is it A1586?) I am planning to use it in UK and I am not sure if it is compatible with the LTE bandwidth.

  • How do i update my IDT soundcard driver? HP pavillion DV7 4032EO

    Dear HP forum! I've recently stumbled onto a problem between my IDT soundcard driver and my Punkbuster(anti-cheat program). so when they collide it causes HARD freeze witch requires a manual shutdown or reset. the IDT soundcard driver on the HP suppo