Re: Mod (%) function in C/Objective-C?
Re: Mod (%) function in C/Objective-C?
- Subject: Re: Mod (%) function in C/Objective-C?
- From: Dave <email@hidden>
- Date: Mon, 11 Aug 2014 22:45:26 +0100
On 11 Aug 2014, at 22:24, Scott Ribe <email@hidden> wrote:
> On Aug 11, 2014, at 3:03 PM, Dave <email@hidden> wrote:
>
>> My conclusion is (a % b) in C is a remainder operator and NOT modulo operator.
>
> Yes. The first edition of K&R mistakenly referred to it as modulus (apparently based on the PDP-11 instruction which was similarly misnamed).
And I bet that happened because originally the hardware was supposed to compute the correct modulus but they couldn’t get it to work!
It’s so amazing to realise how a simple naming error can cause such repercussions…………… I wonder if the original PDP-11 designers realise what they did?!?
Dave
_______________________________________________
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