• 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 11:55:36 -0500

Just to clarify two points...

1. cos( M_PI_2 ) == 6.123233995736766e-17, not 2.6484540326036093e-14 as I posted earlier. That value is the cosine an app-calculated pi/2 having less precision than M_PI_2.

2. It's true, these numbers -are- very close to zero. My questions are:

A) Is the '-llibm' compiler flag sufficient to use the IEEE math lib?

B) If it is, how come the results of cos( pi/2 ) don't agree with the behavior documented in PowerPC Numerics, page 148? Am I doing something else wrong? Googling, I see that some other math libs (Java, for instance) document that one should -not- expect cos( pi/ 2 ) to equal exactly zero. This is at variance with what PowerPC Numerics says OS X does, however.

C) If the behavior documented in PowerPC Numerics doesn't actually occur, what's the proper thing to do? The app has some fairly heavy arithmetic going on, with the results displayed to the user both graphically in text form. Should it round before drawing? Round before displaying text? Both? What have others done in this situation?


_______________________________________________ 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
  • Follow-Ups:
    • Re: problem with cos ( pi/2 )
      • From: Howard Hinnant <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