AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How dividing int by int works? (https://forums.alliedmods.net/showthread.php?t=49000)

geertjan88 12-25-2006 11:03

How dividing int by int works?
 
I got a question how dividing a int by an int works? Like for an example what is the result of dividing 13 by 2?

jopmako 12-25-2006 14:58

Re: How dividing int by int works?
 
new Float:result = float(13)/float(2)

The Specialist 12-25-2006 14:59

Re: How dividing int by int works?
 
Except he wanted to know how dividing by an INTEGER . Not a Float.

cybermind 12-25-2006 16:32

Re: How dividing int by int works?
 
Quote:

Originally Posted by Pawn Language Guide
Results in the division of e1 by e2. The result is truncated to the nearest integral value that is less than or equal to the quotient. Both negative and positive values are rounded down, i.e. towards −infinity.

13 / 2 = 6
-13 / 2 = -7

geertjan88 12-26-2006 08:27

Re: How dividing int by int works?
 
Quote:

Originally Posted by CyberMind (Post 419737)
13 / 2 = 6
-13 / 2 = -7

Thanks +karma for you...


All times are GMT -4. The time now is 22:31.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.