Thread: [Solved] Nonsense Divide
View Single Post
Author Message
ConorCC
Member
Join Date: Feb 2014
Old 06-21-2021 , 06:49   Nonsense Divide
Reply With Quote #1

Hello there!

Can some explain why

static item_count; item_count = 0;
client_print(id, print_chat, "Item Count: %i | Page: %i", item_count, (item_count - 1) / 7);

prints "Item Count: 0 | Page: -1"

instead of

prints "Item Count: 0 | Page: 0"

So why -1 divided by 7 is -1 instead of 0? Shouldn't be it zero?

Please don't think me stupid.

Last edited by ConorCC; 06-26-2021 at 17:07. Reason: Solved
ConorCC is offline