Divide by 2
#2

It won't become a float. All types must be known compile-time, otherwise you'll get an compiler warning of tag mismatch. So, if you divide tagless variable by tagless variable, you'll get tagless result with fraction part discarded: 5 / 2 == 2. If at least one side of operations is a float, then you'll get a float: 5 / 2.0 == 2.5. So, if you do:
pawn Код:
new result = 5 / 2.0;
You'll get a tag mismatch.
Reply


Messages In This Thread
Divide by 2 - by pelican1 - 17.01.2017, 13:46
Re: Divide by 2 - by Misiur - 17.01.2017, 14:00

Forum Jump:


Users browsing this thread: 1 Guest(s)