Simple SAMP Math Symbols Question
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
Or just rearrange:

Код:
a = PlayerInfo[i][pSavings]
b = ((5 / 10) / 100) * a

- In integer maths 5 / 10 = 0...

- Remove unneeded brackets:
b = 5 / 10 / 100 * a

- Move operators about because they all have the same precedence:
b = 5 * a / 10 / 100

- Group operators:
b = 5 * a / (10 * 100)

- Result:
b = 5 * a / 1000
Despite the fact that's the same equation in theory, it can give a different result in integer maths because you're doing the multiplication last.
****** beat me to it.
Jk...
I had the same thought as calg00ne. :S
Reply


Messages In This Thread
Simple SAMP Math Symbols Question - by SkizzoTrick - 31.03.2011, 21:04
Re: Simple SAMP Math Symbols Question - by Calgon - 31.03.2011, 21:07
Re: Simple SAMP Math Symbols Question - by Mauzen - 31.03.2011, 21:09
Re: Simple SAMP Math Symbols Question - by SkizzoTrick - 31.03.2011, 21:11
Re: Simple SAMP Math Symbols Question - by -Rebel Son- - 01.04.2011, 03:34

Forum Jump:


Users browsing this thread: 2 Guest(s)