Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » Ceiling/Floored Modulus in cc65?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Ceiling/Floored Modulus in cc65? [message #359652] Tue, 26 December 2017 05:39
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
I am a little confused about the difference between ceilinged and floored divide/modulus: which handles negative divisors returning negative of absolute remainders and which returns reverse-order positive remainders. I am looking for the latter in a cc65 C program. If I'm not making myself clear, let's say I'm dividing -2 by 3. I want the remainder to 1, not -2. How do I do that? C seems to by default give -2 as the remainder. I also want a vocabulary check as mentioned.

BTW, this is for compression software.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Official FAQ comp.binaries.cbm (semimonthly posting)
Next Topic: Handbooks/disks from Jane M. Voskamp
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon May 13 17:07:27 EDT 2024

Total time taken to generate the page: 0.06564 seconds