Integer division and modulo don't work correctly?
Code:
Code:
5/3=1 5%3=2Code:
Code:
5/3=1 5%3=2 |
Re: Integer division and modulo don't work correctly?
Look what it's writting : Code:
/* forbidden operations */Edit : Sorry I was wrong : So here it is the results : In pawn Code:
5/3 = ( 1.66 = 1) 5 % 3 = 2 Correct ( wrong in the #2 Code ) So one is returning the nearest number to X and c++ the opposite. |
Re: Integer division and modulo don't work correctly?
Quote:
|
Re: Integer division and modulo don't work correctly?
Ofc I was talking about %d since the result return a float num means that %d need to choose > .5 or < .5
|
Re: Integer division and modulo don't work correctly?
Oh, it's ok, because Pawn uses "floored division" instead of "truncated division".
|
| All times are GMT -4. The time now is 23:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.