• 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: Modulus calculation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modulus calculation


  • Subject: Re: Modulus calculation
  • From: Nick Zitzmann <email@hidden>
  • Date: Sun, 1 Jun 2008 19:27:20 -0600


On Jun 1, 2008, at 7:19 PM, vince wrote:

I need to state whether a modulus value = zero.
For example:

if (textField.floatValue % 10 == (0)) {


What's wrong with my syntax?


You can't use % with floating point values. Instead, use fmod() on doubles (CGFloat on 64-bit) and fmodf() on singles (CGFloat on 32- bit). See the man page for details.

Nick Zitzmann
<http://www.chronosnet.com/>




_______________________________________________

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: 
 >Modulus calculation (From: vince <email@hidden>)

  • Prev by Date: Re: to use the default about panel
  • Next by Date: Core Data "entity required" error
  • Previous by thread: Modulus calculation
  • Next by thread: Core Data "entity required" error
  • Index(es):
    • Date
    • Thread