• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: problem with cos ( pi/2 )
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with cos ( pi/2 )


  • Subject: Re: problem with cos ( pi/2 )
  • From: billmonk <email@hidden>
  • Date: Fri, 16 Jun 2006 12:05:59 -0500


On Jun 16, 2006, at 11:33 AM, Christopher Henrich wrote:


http://developer.apple.com/documentation/Darwin/Reference/ManPages/ man3/intro.3.html


Oops; if you're using C (C++, Obj-C, whatever) then I think you want the "-lm" flag.

Oops, my mistake. I read the first paragraph of that reference wrong.

No change in the results I'm getting, though.

"90" is an integer, exactly representable in almost any number format. So here's a case where the machine knows exactly what angle you want. Therefore it can give you exactly the cosine of it.

Sure. But cos() takes radians as its argument, not degrees. So when Calculator converts 90 degrees to radians, it gets a number that isn't exactly representable, and should get the same answer for cos ( 90 ) as it does for cos( pi/2 ). One wonders if it's not special- casing cos( 90 ) in degrees mode, and not calling the cos() function at all...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >problem with cos ( pi/2 ) (From: billmonk <email@hidden>)
 >Re: problem with cos ( pi/2 ) (From: Christopher Henrich <email@hidden>)

  • Prev by Date: RE: problem with cos ( pi/2 )
  • Next by Date: Re: problem with cos ( pi/2 )
  • Previous by thread: Re: problem with cos ( pi/2 )
  • Next by thread: Re: problem with cos ( pi/2 )
  • Index(es):
    • Date
    • Thread