I thought the forward slash '/' was integer divide in C. ????? bobh
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Integer Divide in 'C'
Collapse
X
-
Integer Divide in 'C'
What about % ; I had thought that this returned the equivalent of trunc(a/b). I'm converting a bunch of old DEC 'C' routines to REXX and I stumbled on that one... a = (1 - 14)/12 If a is int or long int; but evidently not in the 'C' that I stumbled onto. WOW!!!!! thnx, bobh
Comment
-
Integer Divide in 'C'
Bob, I could be wrong, but I think that the "%" sign deals with remainders resulting from division. It's sort of like MVR in RPG, or GIVING REMAINDER IN Cobol. I know that I've used "%" in C. I'm pretty it was with remainder and date routines.
Comment
-
Integer Divide in 'C'
The problem turned out to be the Floor function and the % operator which is not the same as a REXX // function. Got the 'C' train back on track, with apologies to the DUKE. The particular stuff giving problems was not from DEC but OS/2, another IBM step-child. thnx for your help... bobh
Comment
Comment