Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Modulus calculation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modulus calculation




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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.