×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Math::IsNaN doesn't work?

    Hi, I'm trying to check if speed, which was retrieved with LBS API, is NaN. The code that i'm using is:

    TPositionCourseInfo iPos;
    ...
    TCourse course;
    iPos.GetCourse(course);

    if (!Math::IsNaN(course.Speed())) {
    /* Write Speed to a file */
    ...

    The problem is that speed was NaN and enter in if statment, and write NaN in file.

    What is the problem?

    Thanks.

    PD: Sorry for my poor english

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,347

    Re: Math::IsNaN doesn't work?

    What was the speed? Please post the value of speed here.
    Nokia Developer Wiki Moderation team

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Re: Math::IsNaN doesn't work?

    Quote Originally Posted by kiran10182 View Post
    What was the speed? Please post the value of speed here.
    Speed was retrieved with LBS API, with Speed() method of TCourse class.

    If you refers to speed value that was written in the file... the value was NaN.

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,347

    Re: Math::IsNaN doesn't work?

    Quote Originally Posted by ivansjg View Post
    Speed was retrieved with LBS API, with Speed() method of TCourse class.
    What if you explicitly fetch the value in some TReal32 variable and debug it?
    Nokia Developer Wiki Moderation team

  5. #5
    Super Contributor
    Join Date
    Jan 2007
    Location
    Bhubaneswar, India
    Posts
    1,189

    Re: Math::IsNaN doesn't work?

    NaN is not a problem. It is defined in literal descriptor in application.
    If your application is not connected to GPS receiver then you will get that message. If Gps receiver is connected then you will not get that message.

    check that you device is connected with GPS receiver.

    If you move from one place to another then you can get speed.
    -------------------------------------
    Thanks & Regards
    Ram
    Symbian OS 9.2/9.3,S60 3rd FP1/FP2,Carbide.c++v2.0

  6. #6
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,347

    Re: Math::IsNaN doesn't work?

    Quote Originally Posted by RB_Sahu View Post
    NaN is not a problem. It is defined in literal descriptor in application.
    If your application is not connected to GPS receiver then you will get that message. If Gps receiver is connected then you will not get that message.

    check that you device is connected with GPS receiver.

    If you move from one place to another then you can get speed.
    Read the question carefully. You will find this: if (!Math::IsNaN(course.Speed())) and the problem is NaN is written in the file.

    And NaN is not "not a problem". It is "Not a Number".
    Nokia Developer Wiki Moderation team

  7. #7
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Re: Math::IsNaN doesn't work?

    Quote Originally Posted by RB_Sahu View Post
    NaN is not a problem. It is defined in literal descriptor in application.
    If your application is not connected to GPS receiver then you will get that message. If Gps receiver is connected then you will not get that message.

    check that you device is connected with GPS receiver.

    If you move from one place to another then you can get speed.

    I know that. I can get speed before second GPS adquisition, but in first GPS adquisition the speed is often NaN. And if speed is NaN, the program couldn't enter in the if statment and write speed value to the file.

  8. #8
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Re: Math::IsNaN doesn't work?

    Quote Originally Posted by kiran10182 View Post
    What if you explicitly fetch the value in some TReal32 variable and debug it?
    Ok, I will try this, but, after the second GPS adquisition, the speed value was written correctly in a file. I see now that Math::IsNaN recieve a TReal64... could be a problem that I was passed a TReal32? Would a cast to TReal64 suitable?

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,347

    Re: Math::IsNaN doesn't work?

    Quote Originally Posted by ivansjg View Post
    Ok, I will try this, but, after the second GPS adquisition, the speed value was written correctly in a file. I see now that Math::IsNaN recieve a TReal64... could be a problem that I was passed a TReal32? Would a cast to TReal64 suitable?
    It should not create problem. You don't need to cast it. See this similar thread and read last reply from Lucian. http://discussion.forum.nokia.com/fo...d.php?t=147602
    Nokia Developer Wiki Moderation team

Similar Threads

  1. Replies: 2
    Last Post: 2004-04-27, 10:36
  2. CommConnection does not work with Series 60 SDK, but works in JWT
    By jackiechan2001 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-02-04, 09:07
  3. Does SDK v2.0 work on Series60 V6.1?
    By liying in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2004-02-02, 08:57
  4. does irda function work with the emulator ?
    By IGhost in forum Symbian
    Replies: 0
    Last Post: 2002-12-07, 17:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×