Wrong calculations?
#2

pawn Код:
points = rank/7;
An integer divided by an integer results in an integer. The fractional part (anything behind the dot) of the division is simply dropped, no rounding occurs. For example, 6/7 is 0.857... but since the fractional part is dropped, 0 is returned. If you need the fractional part you need to make that variable a float.
Reply


Messages In This Thread
Wrong calculations? - by wooolly - 02.03.2015, 20:35
Re: Wrong calculations? - by Vince - 02.03.2015, 20:59
Re: Wrong calculations? - by wooolly - 02.03.2015, 21:20
AW: Re: Wrong calculations? - by Nero_3D - 02.03.2015, 22:42
Re: Wrong calculations? - by wooolly - 02.03.2015, 22:56

Forum Jump:


Users browsing this thread: 1 Guest(s)