• 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: Can anyone explain this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can anyone explain this?


  • Subject: Re: Can anyone explain this?
  • From: Peter Ammon <email@hidden>
  • Date: Fri, 12 Sep 2008 16:05:43 -0700


On Sep 12, 2008, at 1:31 PM, Roland Silver wrote:

Can anyone explain this?
The value of the expression is apparently different from the value of a variable assigned to that expression:


double pitch = A0Pitch * pow(2.0, ntones/ currentTonesPerOctave(voice)) ;
NSLog(@"expression value: %f", A0Pitch * pow(2.0, ntones/ currentTonesPerOctave(voice)));
2008-09-12 16:25:08.095 AttoComp[10566:813] pitch value: 28.305812
NSLog(@"variable value: %f", pitch);
2008-09-12 16:25:08.094 AttoComp[10566:813] pitch variable: nan

A common reason for this is that you do not have a prototype for pow() in scope. Make sure you #include <math.h>


-Peter

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Can anyone explain this? (From: Roland Silver <email@hidden>)

  • Prev by Date: Re: Windows
  • Next by Date: Re: Programmatically dismiss NSPopUpButton menu
  • Previous by thread: Can anyone explain this?
  • Next by thread: App name from Bundle Identifier?
  • Index(es):
    • Date
    • Thread