Thread: How do...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    44
    Do you have an IDE, like Borland CBuilder, MS Visual C++, or anything to that effect? If so, usually you can use the help function to search when you're just looking for a function.

    Searching cos would probably yield acos as an alternate result.

  2. #2
    Registered User
    Join Date
    Feb 2005
    Posts
    19
    I use acos() but, it does not calculate properly

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    44
    Are you assigning it to an integer variable? Make sure you're using a float.

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    19
    what do u mean float?
    i didn't assign it to anything

  5. #5
    Registered User
    Join Date
    Feb 2005
    Posts
    19
    I keep getting...

    -1.#IND

    as my answer

  6. #6
    Registered User
    Join Date
    Feb 2005
    Posts
    44
    What are you doing with it?

    You either need to use it in an expression or assign it to a variable.

    float accepts decimal values. Integers, as you know, cannot - int in C++ is the same as a real-life integer where no decimal values are allowed

  7. #7
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Radians?

    All of the trig functions in <cmath> use radians, not degrees. Maybe that will help. (?)

  8. #8
    Registered User
    Join Date
    May 2003
    Posts
    82
    Quote Originally Posted by MyDestiny
    I use acos() but, it does not calculate properly
    Post the code.

Popular pages Recent additions subscribe to a feed