On Aug 12, 2014, at 1:42 AM, Dave <d...@looktowindward.com> wrote: >> Maybe my brain isn't working correctly but that doesn't make sense to me. >> Could you show the output with both x and y shown? Now, you aren't dividing >> by a negative integer, are you? I believe that is undefined…
Yes, it's my brain. I just needed to see it to make sense of it. > I’m not doing any division, the function for “myMod” is as I posted: Well, it is the divisor I was asking about and although you aren't interested in the quotient, you are asking for division to occur. > If you think of the number as being used as an Index into an NSArray, you can > see why a true mod function is better, e.g. -1 gets you the last element, -2 > the second from last and so on. I see that you are interested in a circular index. Most of the time I find myself needing a "remainder" result more than a true modulo, so I use abs(). That definitely won't work when you need the true series. Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com