On Aug 11, 2014, at 2:52 PM, Dave <d...@looktowindward.com> wrote:

> On 10 Aug 2014, at 16:16, Keary Suska <cocoa-...@esoteritech.com> wrote:
> 
> 
>> I don't think so, although I would expect a C lib somewhere to address it. 
>> Anyway, isn't easier to just always abs(x)%y?
>> 
> 
> 
>> abs(x)%y
> 
> Doesn’t give the same result, it’s one off:
> 
> myIndex: -5  myMod: 1   abs(x)%y: 2
> myIndex: -4  myMod: 2  abs(x)%y: 1
> myIndex: -3  myMod: 0  abs(x)%y: 0
> myIndex: -2  myMod: 1  abs(x)%y: 2
> myIndex: -1  myMod: 2  abs(x)%y: 1
> myIndex: 0  myMod: 0  abs(x)%y: 0
> myIndex: 1  myMod: 1  abs(x)%y: 1
> myIndex: 2  myMod: 2  abs(x)%y: 2
> myIndex: 3  myMod: 0  abs(x)%y: 0
> myIndex: 4  myMod: 1  abs(x)%y: 1
> 
> Where:
> 
> myIndex = input value.
> myMod = result of calling the mod function I added.
> abs(x)%y =  abs(x)%y.

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

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

Reply via email to